From bcda6ac0c82ddf7d08389970d1c0d528f1aebf54 Mon Sep 17 00:00:00 2001 From: Olivier Date: Fri, 10 Dec 2021 17:09:24 +0100 Subject: [PATCH] Update format string for json logger --- prometheus_pgbouncer_exporter/cli.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus_pgbouncer_exporter/cli.py b/prometheus_pgbouncer_exporter/cli.py index b81a5da..291a86c 100644 --- a/prometheus_pgbouncer_exporter/cli.py +++ b/prometheus_pgbouncer_exporter/cli.py @@ -44,7 +44,7 @@ def main(): # Init logger logHandler = logging.FileHandler(args.log_file) if args.log_file is not "stdout" else logging.StreamHandler() - formatter = jsonlogger.JsonFormatter("(asctime) (levelname) (message)", datefmt="%Y-%m-%d %H:%M:%S") + formatter = jsonlogger.JsonFormatter("%(asctime)s %(levelname)s %(message)s", datefmt="%Y-%m-%d %H:%M:%S") logHandler.setFormatter(formatter) logging.getLogger().addHandler(logHandler) logging.getLogger().setLevel(args.log_level) diff --git a/requirements.txt b/requirements.txt index 1a142bf..9440cf2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ psycopg2==2.8.5 prometheus_client==0.8.0 -python-json-logger==0.1.11 +python-json-logger==2.0.1 pycodestyle PyYAML==5.3.1