| 731 | |
| 732 | |
| 733 | class FileHandler(logging.FileHandler): |
| 734 | def __init__(self, module_inst: Any): |
| 735 | path = module_inst.get_ceph_option("log_file") |
| 736 | idx = path.rfind(".log") |
| 737 | if idx != -1: |
| 738 | self.path = "{}.{}.log".format(path[:idx], module_inst.module_name) |
| 739 | else: |
| 740 | self.path = "{}.{}".format(path, module_inst.module_name) |
| 741 | super(FileHandler, self).__init__(self.path, delay=True) |
| 742 | self.setFormatter(logging.Formatter("%(asctime)s [%(threadName)s] [%(levelname)-4s] [%(name)s] %(message)s")) |
| 743 | |
| 744 | |
| 745 | class MgrModuleLoggingMixin(object): |