mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-01 21:43:28 -05:00
logging improvements (#2073)
* Scheduled tasks log to Debug, not Info * Add LOG_LEVEL config to .env * Update some other log levels and fix typos * fix logger initializer --------- Co-authored-by: Jakob Rubin <647846+Grygon@users.noreply.github.com>
This commit is contained in:
@@ -27,6 +27,8 @@ class LoggerConfig:
|
||||
def get_logger_config():
|
||||
settings = get_app_settings()
|
||||
|
||||
log_level = logging._nameToLevel[settings.LOG_LEVEL]
|
||||
|
||||
if not settings.PRODUCTION:
|
||||
from rich.logging import RichHandler
|
||||
|
||||
@@ -35,6 +37,7 @@ def get_logger_config():
|
||||
format=None,
|
||||
date_format=None,
|
||||
logger_file=None,
|
||||
level=log_level,
|
||||
)
|
||||
|
||||
output_file_handler = logging.FileHandler(LOGGER_FILE)
|
||||
@@ -50,6 +53,7 @@ def get_logger_config():
|
||||
format="%(levelname)s: %(asctime)s \t%(message)s",
|
||||
date_format="%d-%b-%y %H:%M:%S",
|
||||
logger_file=LOGGER_FILE,
|
||||
level=log_level,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class AppSettings(BaseSettings):
|
||||
API_DOCS: bool = True
|
||||
TOKEN_TIME: int = 48 # Time in Hours
|
||||
SECRET: str
|
||||
LOG_LEVEL: str = "INFO" # Corresponds to standard Python log levels.
|
||||
|
||||
GIT_COMMIT_HASH: str = "unknown"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user