7

Is there a way to disable the logging of the parameter values used in a query, while still logging the actual query itself?

I'd like to set log_min_duration_statement = 0 to use with pgBadger. I'm getting two lines per query like:

LOG: Select * from table where id = $1

DETAIL: parameters: $1 = 55

I'd really like to suppress the DETAIL lines because it's bloating my logs and saving sensitive information.

Is it possible to disable this from within Postgres?

1 Answer 1

11

You can set log_error_verbosity = TERSE

The manual:

Controls the amount of detail written in the server log for each message that is logged. Valid values are TERSE, DEFAULT, and VERBOSE, each adding more fields to displayed messages. TERSE excludes the logging of DETAIL, HINT, QUERY, and CONTEXT error information.

Bold emphasis mine.

1
  • Where to set this? Do I need to restart Postgres after? Jun 4, 2017 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.