From 4396e4b6364c2e9f8465900de4a5241b72d838ed Mon Sep 17 00:00:00 2001 From: alexandrenegreira <75072686+alexandrenegreira@users.noreply.github.com> Date: Tue, 15 Dec 2020 13:00:47 +0100 Subject: [PATCH] Fix python 3 issue Resolve this log format issue with Python 3 https://github.com/spreaker/prometheus-pgbouncer-exporter/issues/30 --- prometheus_pgbouncer_exporter/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prometheus_pgbouncer_exporter/cli.py b/prometheus_pgbouncer_exporter/cli.py index b81a5da..6ee0393 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("%(message)%(levelname)%(name)%(asctime)") logHandler.setFormatter(formatter) logging.getLogger().addHandler(logHandler) logging.getLogger().setLevel(args.log_level)