Skip to content

Default log level (info) also logs debug messages, overriding log level has no effect. #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
darkl0rd opened this issue Aug 14, 2021 · 3 comments

Comments

@darkl0rd
Copy link

What did you do?
Start the postgres-exporter with the default log-level set (info), and started it with the log-level explicitly set to 'info' (--log.level=info)

What did you expect to see?
Only info, error and warn messages to be logged

What did you see instead? Under which circumstances?
All log categories being logged (i.e. including debug)

Environment

  • postgres_exporter version:
0.10.0
  • postgres_exporter flags:
--log.level=info 
  • PostgresSQL version:
13.3
  • Logs:
$ postgres_exporter --log.level=info
ts=2021-08-14T06:22:48.830Z caller=log.go:168 level=debug msg="Querying PostgreSQL version" server=xxxx
ts=2021-08-14T06:22:48.831Z caller=log.go:168 level=debug msg="Querying pg_setting view" server=xxxx
ts=2021-08-14T06:22:48.834Z caller=log.go:168 level=debug msg="Querying namespace" namespace=pg_locks
ts=2021-08-14T06:22:48.835Z caller=log.go:168 level=debug msg="Querying namespace" namespace=pg_stat_replication
ts=2021-08-14T06:22:48.837Z caller=log.go:168 level=debug msg="Querying namespace" namespace=pg_database
...
...
@bobykus31
Copy link

bobykus31 commented Aug 25, 2021

Funny it is starting with level=info and then switching to level=debug

Aug 25 10:17:18 pghost postgres_exporter[20021]: ts=2021-08-25T10:17:18.685Z caller=log.go:168 level=info msg="Listening on address" address=:9187
Aug 25 10:17:18 pghost postgres_exporter[20021]: level=info ts=2021-08-25T10:17:18.685Z caller=tls_config.go:191 msg="TLS is disabled." http2=false
Aug 25 10:17:22 pghost postgres_exporter[20021]: ts=2021-08-25T10:17:22.422Z caller=log.go:168 level=info msg="Established new database connection" fingerprint=/var/run/postgresql/:5432
Aug 25 10:17:22 pghost postgres_exporter[20021]: ts=2021-08-25T10:17:22.435Z caller=log.go:168 level=debug msg="Querying PostgreSQL version" server=/var/run/postgresql/:5432
Aug 25 10:17:22 pghost postgres_exporter[20021]: ts=2021-08-25T10:17:22.486Z caller=log.go:168 level=info msg="Semantic version changed" server=/var/run/postgresql/:5432 from=0.0.0 to=10.16.0
Aug 25 10:17:22 pghost postgres_exporter[20021]: ts=2021-08-25T10:17:22.497Z caller=log.go:168 level=debug msg="New user metric namespace from YAML metric" metric=pg_stat_user_tables cache_seconds=0

@foarsitter
Copy link

Experience the same, #560 will fix this I guess.

@priiiiit
Copy link

priiiiit commented Feb 3, 2022

Should be fixed by merged PR #560 I guess.
Duplicate of this ticket #557 is already closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants