diff --git a/CHANGES.rst b/CHANGES.rst index b0d1031d..394b866d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -44,6 +44,7 @@ Bugfixes & Improvements - Fix total comments count calculation (`#997`_, pkvach) - Fix newline character handling in data-isso-* i18n strings (`#992`_, pkvach) - Add link logging for management of new comments in Stdout (`#1016`_, pkvach) +- Change logging to include datetime and loglevel (`#1023`_, ix5) .. _#951: https://github.com/posativ/isso/pull/951 .. _#967: https://github.com/posativ/isso/pull/967 @@ -54,6 +55,7 @@ Bugfixes & Improvements .. _#997: https://github.com/isso-comments/isso/pull/997 .. _#992: https://github.com/isso-comments/isso/pull/992 .. _#1016: https://github.com/isso-comments/isso/pull/1016 +.. _#1023: https://github.com/isso-comments/isso/pull/1023 0.13.1.dev0 (2023-02-05) ------------------------ diff --git a/isso/__init__.py b/isso/__init__.py index 53d34c09..d92247e3 100644 --- a/isso/__init__.py +++ b/isso/__init__.py @@ -69,10 +69,11 @@ from isso.ext.notifications import Stdout, SMTP +LOG_FORMAT = "%(asctime)s:%(levelname)s: %(message)s" logging.getLogger('werkzeug').setLevel(logging.WARN) logging.basicConfig( level=logging.INFO, - format="%(asctime)s %(levelname)s: %(message)s") + format=LOG_FORMAT) logger = logging.getLogger("isso") @@ -280,6 +281,7 @@ def main(): if conf.get("general", "log-file"): handler = logging.FileHandler(conf.get("general", "log-file")) + handler.setFormatter(logging.Formatter(LOG_FORMAT)) logger.addHandler(handler) logging.getLogger("werkzeug").addHandler(handler)