implement charge log and rule function