Logging in postgresql.conf - no SQL statements are logged

Started by Nico Grubertover 19 years ago2 messagesgeneral
Jump to latest
#1Nico Grubert
nicogrubert@gmail.com

Dear list members,

I would like to enable logging and write every SQL command that is
executed in a logfile so I modified the "postgresql.conf" file in order
to log everything. I restarted the Postgres SQL server. Unfortunately,
no SQL statements are logged in the logfile.

Here is a snippet of my postgresql.conf:

#---------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#---------------------------------------------------------------------------

# - Where to Log -

log_destination = 'stderr'

# This is used when logging to stderr:
redirect_stderr = true

# These are only used if redirect_stderr is on:
log_directory = '/data/pgsql/log'

log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'

#log_truncate_on_rotation = off

log_rotation_age = 1440
#log_rotation_size = 10240

# These are relevant when logging to syslog:
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'

# - When to Log -

#client_min_messages = notice

...

#---------------------------------------------------------------------------
# RUNTIME STATISTICS
#---------------------------------------------------------------------------

Did I miss something?

Kind regards,
Nico

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Nico Grubert (#1)
Re: Logging in postgresql.conf - no SQL statements are logged

am Fri, dem 10.11.2006, um 10:48:12 +0100 mailte Nico Grubert folgendes:

Dear list members,

I would like to enable logging and write every SQL command that is
executed in a logfile so I modified the "postgresql.conf" file in order
...
Did I miss something?

Yes, change this line:

#log_statement = 'none' # none, mod, ddl, all

to:

log_statement = 'all'

and then reload the config

Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47215, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net