LogFile Management

From: Peter Elmers <p(dot)elmers(at)gmx(dot)de>
To: pgsql-novice(at)postgresql(dot)org
Subject: LogFile Management
Date: 2007-03-20 09:19:39
Message-ID: 778CC40F-CF61-45AE-A5B4-67C3BF4E7DE0@gmx.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi!

After countless tries for configuring postgres logmanagement without
success, i hope the community can help me solving the following problem:

I would like to have postgres write logfiles, which must not exceed a
specific size all together. After the files have reached the desired
size, it would be nice that the files will

a) be overwritten or
b) rotate and are overwritten after reaching the limit of file numbers.

I am sorry to say that log_filename = 'g_pgsql.log%a' is not an
option because the logfiles can increase rapidly within a few minutes.

This is the current configuration:

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

# - Where to Log -

#log_destination = 'stderr' # Valid values are combinations of
# stderr, syslog and eventlog,
# depending on platform.

# This is used when logging to stderr:
redirect_stderr = on # Enable capturing of stderr into log
# files
# (change requires restart)

# These are only used if redirect_stderr is on:
log_directory = '/Library/Application\ Support/Test/
PostgreSQL_logs/' # Directory where log files are written
# Can be absolute or relative to PGDATA
log_filename = 'g_pgsql.log' # Log file name pattern.
# Can include strftime() escapes
log_truncate_on_rotation = on # If on, any existing log file of the same
# name as the new log file will be
# truncated rather than appended to. But
# such truncation only occurs on
# time-driven rotation, not on restarts
# or size-driven rotation. Default is
# off, meaning append to existing files
# in all cases.
#log_rotation_age = 0 # Automatic rotation of logfiles will
# happen after that time. 0 to
# disable.
log_rotation_size = 1MB # Automatic rotation of logfiles will
# happen after that much log
# output. 0 to disable.

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

The generated logfile-names:

g_pgsql.log.1173887776
g_pgsql.log.1173974605
g_pgsql.log.1174028625

Best Regards,

Peter

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Shane Ambler 2007-03-20 13:35:30 Re: LogFile Management
Previous Message Ashish Karalkar 2007-03-20 05:08:06 Formating Date Data Type?