mss_dataserver.core.util.get_logger_rotating_file_handler

mss_dataserver.core.util.get_logger_rotating_file_handler(filename=None, log_level='INFO', max_bytes=1000, backup_count=3)[source]

Create a logging rotating file handler.

Create a logging RotatingFileHandler and ad a Formatter to it.

Parameters
  • filename (str) – The full path of the log file.

  • log_level (str) – The logging log level. [‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’]

  • max_bytes (int) – The maximum filesize of the log file [bytes]. If the file grows larger than this value, a new file is created.

  • backup_count (int) – The number of rotating files to use.

Returns

ch – The logging filehandler.

Return type

logging.handlers.RotatingFileHandler