From 756900cba99f56a389fedc1744b0981fd430fd4e Mon Sep 17 00:00:00 2001 From: louis chauvet Date: Sat, 11 Aug 2018 01:44:27 +0200 Subject: [PATCH] Add a basic log config file --- log_config.json | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 log_config.json diff --git a/log_config.json b/log_config.json new file mode 100644 index 0000000..00e0c27 --- /dev/null +++ b/log_config.json @@ -0,0 +1,59 @@ +{ + "version": 1, + "disable_existing_loggers": false, + "formatters": { + "simple": { + "format": "%(asctime)s :: %(name)s :: %(levelname)s :: %(message)s" + } + }, + + "handlers": { + "console": { + "class": "logging.StreamHandler", + "level": "DEBUG", + "formatter": "simple", + "stream": "ext://sys.stdout" + }, + + "info_file_handler": { + "class": "logging.handlers.RotatingFileHandler", + "level": "INFO", + "formatter": "simple", + "filename": "info.log", + "maxBytes": 10485760, + "backupCount": 20, + "encoding": "utf8" + }, + + "error_file_handler": { + "class": "logging.handlers.RotatingFileHandler", + "level": "ERROR", + "formatter": "simple", + "filename": "errors.log", + "maxBytes": 10485760, + "backupCount": 20, + "encoding": "utf8" + }, + "sms_handler": { + "class":"SMSHandler.SMSHandler", + "level":"ERROR", + "formatter": "simple" + } + }, + + "loggers": { + "foBot": { + "level": "DEBUG", + "handlers": ["console", "info_file_handler", "error_file_handler", "sms_handler"] + }, + "discord": { + "level":"WARNING", + "handlers":["console","error_file_handler"] + } + }, + + "root": { + "level": "INFO", + "handlers": ["console", "info_file_handler", "error_file_handler"] + } +} \ No newline at end of file