I am using the log_min_error_statement - Setting in the PostgreSQL configuration file, but the logger does not react on the setting, either if I turn it on, or off, or set it to another level, the logger logs every statement. Could this be a possible bug in PostgreSQL logging?

  • 2
    Did you cause Postgres to re-read the configuration file after the change? – mustaccio Aug 6 '15 at 18:23
  • sure, saved the file, reread the config file, and also stopped and restarted the service several times – Erdinc Ay Aug 6 '15 at 21:48
  • 2
    In the running daemon, can you run SHOW log_min_error_statement; and make sure it matches up with your PostgreSQL config? Also, are there any errors regarding configuration in your logs? – Kassandry Aug 6 '15 at 23:24
  • currently i can't access the server, i will be granted to access it next week again, will give you updates, what is the difference between log_min_error_statement and log_min_messages – Erdinc Ay Aug 7 '15 at 7:28
  • 1
    A common issue is changing settings in wrong postgres config file e.g. on a Debian based system with different postgres major versions running/installed/. So a maybe to easy thing: Did you change the correct file ;) ? – frlan Aug 7 '15 at 7:56

the logger logs every statement

Then that behavior comes from log_statement:

log_statement (enum)

Controls which SQL statements are logged. Valid values are none (off), ddl, mod, and all (all statements). ddl logs all data definition statements,

  • yes i had to turn that to all, but there is no other granularity for statements, i need them, but only if errors occur, i thought maybe log_min_message can trigger when statements are logged, will have to test it next week, by the way, is there anyone that knows in which order and how the evaluation of the log configurations is done? – Erdinc Ay Aug 7 '15 at 11:05
  • 2
    @ErdincAy Logging only when errors occur is the default configuration. For your questions there's an entire doc page about it, please read it: postgresql.org/docs/current/static/runtime-config-logging.html – Daniel Vérité Aug 7 '15 at 11:23
  • 1
    I do understand your comment, and I also know the PostgreSQL article to this topic, but where is the LOGIC, which config counts first, which ORDER is being used to trigger, filter, write the logs? I can't imagine that all these people have an execution plan for PostgreSQL in their brains. – Erdinc Ay Aug 10 '15 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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