diff --git a/command_line_assistant/logger.py b/command_line_assistant/logger.py index 65ab45a..4984fdb 100644 --- a/command_line_assistant/logger.py +++ b/command_line_assistant/logger.py @@ -33,11 +33,16 @@ "formatter": "audit", "mode": "a", }, + "audit_journald": { + "class": "logging.StreamHandler", + "stream": "ext://sys.stdout", + "formatter": "audit", + }, }, "loggers": { "root": {"handlers": ["console"], "level": "DEBUG"}, "audit": { - "handlers": ["audit_file", "console"], + "handlers": ["audit_file", "audit_journald", "console"], "level": "INFO", "propagate": False, }, @@ -110,6 +115,13 @@ def format(self, record: logging.LogRecord) -> str: def _create_audit_formatter(config: Config) -> AuditFormatter: """Internal method to create a new audit formatter instance. + Note: + This appears to be not used, but the logging class will call this + function to initialize the formatter options for audit logger. + + Do not remove this function, only if there is a better idea on how to + do it. + Args: config (Config): The application configuration