diff --git a/README.md b/README.md index 07f6c35..f39c507 100644 --- a/README.md +++ b/README.md @@ -193,20 +193,6 @@ googleSearchResults = 3 # number of google search results to include in the cont llm_history_limit = 6 # limit the history to 3 messages (come in pairs) more results = more compute time ``` -Logging messages to disk or Syslog to disk uses the python native logging function. Take a look at the [/modules/log.py](/modules/log.py) you can set the file logger for syslog to INFO for example to not log DEBUG messages to file log, or modify the stdOut level. -``` -[general] -# logging to file of the non Bot messages -LogMessagesToFile = True -# Logging of system messages to file -SyslogToFile = True -``` -Example to log to disk only INFO and higher (ignore DEBUG) -``` -*log.py -file_handler.setLevel(logging.INFO) # DEBUG used by default for system logs to disk example here shows INFO -``` - The Scheduler is enabled in the [settings.py](modules/settings.py) by setting `scheduler_enabled = True` the actions and settings are via code only at this time. see [mesh_bot.py](mesh_bot.py) around line [425](https://github.com/SpudGunMan/meshing-around/blob/22983133ee4db3df34f66699f565e506de296197/mesh_bot.py#L425-L435) to edit schedule its most flexible to edit raw code right now. See https://schedule.readthedocs.io/en/stable/ for more. ``` diff --git a/logs/README.md b/logs/README.md new file mode 100644 index 0000000..75ba013 --- /dev/null +++ b/logs/README.md @@ -0,0 +1,15 @@ +Logs will collect here. + +Logging messages to disk or Syslog to disk uses the python native logging function. Take a look at the [/modules/log.py](/modules/log.py) you can set the file logger for syslog to INFO for example to not log DEBUG messages to file log, or modify the stdOut level. +``` +[general] +# logging to file of the non Bot messages +LogMessagesToFile = True +# Logging of system messages to file +SyslogToFile = True +``` +Example to log to disk only INFO and higher (ignore DEBUG) +``` +*log.py +file_handler.setLevel(logging.INFO) # DEBUG used by default for system logs to disk example here shows INFO +``` \ No newline at end of file diff --git a/modules/log.py b/modules/log.py index e6699b8..e202946 100644 --- a/modules/log.py +++ b/modules/log.py @@ -59,14 +59,14 @@ stdout_handler.setFormatter(CustomFormatter(logFormat)) logger.addHandler(stdout_handler) if syslog_to_file: # Create file handler for logging to a file - file_handler = logging.FileHandler('system{}.log'.format(today.strftime('%Y_%m_%d'))) + file_handler = logging.FileHandler('logs/system{}.log'.format(today.strftime('%Y_%m_%d'))) file_handler.setLevel(logging.DEBUG) # DEBUG used by default for system logs to disk file_handler.setFormatter(logging.Formatter(logFormat)) logger.addHandler(file_handler) if log_messages_to_file: # Create file handler for logging to a file - file_handler = logging.FileHandler('messages{}.log'.format(today.strftime('%Y_%m_%d'))) + file_handler = logging.FileHandler('logs/messages{}.log'.format(today.strftime('%Y_%m_%d'))) file_handler.setLevel(logging.INFO) # INFO used for messages to disk file_handler.setFormatter(logging.Formatter(msgLogFormat)) msgLogger.addHandler(file_handler)