[logging] Some cleanup and improved configuring using user config

This commit is contained in:
Ferdinand Thiessen 2021-11-16 13:43:19 +01:00
parent 0ef9d18ace
commit 45ed9219a4
2 changed files with 12 additions and 4 deletions

View File

@ -14,10 +14,15 @@ secret_key = "V3ryS3cr3t"
#domain = "flaschengeist.local" #domain = "flaschengeist.local"
[LOGGING] [LOGGING]
# You can override all settings from the logging.toml here
# E.g. override the formatters etc
#
# Logging level, possible: DEBUG INFO WARNING ERROR
level = "DEBUG"
# Uncomment to enable logging to a file # Uncomment to enable logging to a file
# file = "/tmp/flaschengeist-debug.log" # file = "/tmp/flaschengeist-debug.log"
# Logging level, possible: DEBUG INFO WARNING ERROR # Uncomment to disable console logging
level = "WARNING" # console = False
[DATABASE] [DATABASE]
# engine = "mysql" (default) # engine = "mysql" (default)

View File

@ -1,9 +1,12 @@
# This is the default flaschengeist logger configuration
# If you want to customize it, use the flaschengeist.toml
version = 1 version = 1
disable_existing_loggers = false disable_existing_loggers = false
[formatters] [formatters]
[formatters.simple] [formatters.simple]
format = "%(asctime)s - %(name)s - %(message)s" format = "%(asctime)s - %(name)s (%(levelname)s) - %(message)s"
[formatters.extended] [formatters.extended]
format = "%(asctime)s — %(filename)s - %(funcName)s - %(lineno)d - %(threadName)s - %(name)s — %(levelname)s — %(message)s" format = "%(asctime)s — %(filename)s - %(funcName)s - %(lineno)d - %(threadName)s - %(name)s — %(levelname)s — %(message)s"