Обсуждение: logging issue

Поиск
Список
Период
Сортировка

logging issue

От
"Campbell, Lance"
Дата:

PostgreSQL 9.1.3

 

I just moved our test database from PostgreSQL 9.0 to 9.1.  I also changed my log settings.   I am seeing every single SQL statement that PostgreSQL performs by my Java applications.  Is there some way to only display the details when there is an error?  I would assume yes.  But for some reason I am getting all SQL statements.  I just want the errors.  I have included below my settings for the logging section.  Any help would be greatly appreciated.  Thanks!

 

#------------------------------------------------------------------------------

# ERROR REPORTING AND LOGGING

#------------------------------------------------------------------------------

 

# - Where to Log -

 

#log_destination = 'stderr'             # Valid values are combinations of    

 

logging_collector = on          # Enable capturing of stderr and csvlog

 

#log_directory = 'pg_log'               # directory where log files are written,

 

log_filename = 'postgresql-9_1-%a.log'  # log file name pattern,

 

#log_file_mode = 0600                   # creation mode for log files,

 

log_truncate_on_rotation = on           # If on, an existing log file with the

 

#log_rotation_age = 1d                  # Automatic rotation of logfiles will

 

log_rotation_size = 50MB                # Automatic rotation of logfiles will

 

#syslog_facility = 'LOCAL0'

#syslog_ident = 'postgres'

#silent_mode = off                      # Run server silently.

#client_min_messages = notice           # values in order of decreasing detail:

#log_min_messages = warning             # values in order of decreasing detail:

#log_min_error_statement = error        # values in order of decreasing detail:

#log_min_duration_statement = -1        # -1 is disabled, 0 logs all statements

 

#debug_print_parse = off

#debug_print_rewritten = off

#debug_print_plan = off

#debug_pretty_print = on

#log_checkpoints = off

#log_connections = off

#log_disconnections = off

#log_duration = off

#log_error_verbosity = default          # terse, default, or verbose messages

#log_hostname = off

 

log_line_prefix = '%u::%t '                     # special values:

 

#log_lock_waits = off                   # log lock waits >= deadlock_timeout

 

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

 

#log_temp_files = -1                    # log temporary files equal or larger

#log_timezone = '(defaults to server environment setting)'

 

 

Thanks,

 

Lance Campbell

Software Architect

Web Services at Public Affairs

217-333-0382

 

 

Re: logging issue

От
Jerry Sievers
Дата:
"Campbell, Lance" <lance@illinois.edu> writes:

> PostgreSQL 9.1.3
>
> I just moved our test database from PostgreSQL 9.0 to 9.1.  I also
> changed my log settings.  I am seeing every single SQL statement
> that PostgreSQL performs by my Java applications.  Is there some way
> to only display the details when there is an error?  I would assume
> yes.  But for some reason I am getting all SQL statements.  I just
> want the errors.  I have included below my settings for the logging
> section.  Any help would be greatly appreciated.  Thanks!
>
Change log_statement to 'none' and pg_ctl reload the server.

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 305.321.1144

Re: logging issue

От
"Campbell, Lance"
Дата:
Thanks so much for the response.  Logging works great.

Many thanks to the PostgreSQL development team for building such a wonderful database.  9.1 is working great.

Thanks,

Lance Campbell
Software Architect
Web Services at Public Affairs
217-333-0382


-----Original Message-----
From: Jerry Sievers [mailto:gsievers19@comcast.net]
Sent: Tuesday, March 06, 2012 3:43 PM
To: Campbell, Lance
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] logging issue

"Campbell, Lance" <lance@illinois.edu> writes:

> PostgreSQL 9.1.3
>
> I just moved our test database from PostgreSQL 9.0 to 9.1.  I also
> changed my log settings.  I am seeing every single SQL statement that
> PostgreSQL performs by my Java applications.  Is there some way to
> only display the details when there is an error?  I would assume yes.
> But for some reason I am getting all SQL statements.  I just want the
> errors.  I have included below my settings for the logging section.
> Any help would be greatly appreciated.  Thanks!
>
Change log_statement to 'none' and pg_ctl reload the server.

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 305.321.1144