Skip to content

Commit

Permalink
Update format string for json logger
Browse files Browse the repository at this point in the history
Copied from spreaker#42
  • Loading branch information
Alan Braggins committed Apr 27, 2022
1 parent 9f6c5b5 commit 3adfd57
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion prometheus_pgbouncer_exporter/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
setup(
name = 'prometheus-pgbouncer-exporter',
packages = ['prometheus_pgbouncer_exporter'],
version = '2.1.1',
version = '2.1.2',
description = 'Prometheus exporter for PgBouncer',
long_description = long_description,
long_description_content_type = "text/markdown",
Expand All @@ -22,7 +22,7 @@
keywords = ['prometheus', 'pgbouncer'],
classifiers = [],
python_requires = ' >= 3',
install_requires = ['psycopg2 == 2.8.5', 'prometheus_client==0.8.0', 'python-json-logger==0.1.11', 'PyYAML==5.3.1'],
install_requires = ['psycopg2 == 2.8.5', 'prometheus_client==0.8.0', 'python-json-logger==0.1.11', 'PyYAML>=5.4.1'],
entry_points = {
'console_scripts': [
'pgbouncer-exporter=prometheus_pgbouncer_exporter.cli:main',
Expand Down

0 comments on commit 3adfd57

Please sign in to comment.