LogFile Management

Поиск
Список
Период
Сортировка
От Peter Elmers
Тема LogFile Management
Дата
Msg-id 778CC40F-CF61-45AE-A5B4-67C3BF4E7DE0@gmx.de
обсуждение исходный текст
Ответы Re: LogFile Management  (Shane Ambler <pgsql@Sheeky.Biz>)
Список 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



В списке pgsql-novice по дате отправления:

Предыдущее
От: Aly Dharshi
Дата:
Сообщение: Re: [HACKERS] initdb fails - postgresql does not support leap seconds
Следующее
От: Shane Ambler
Дата:
Сообщение: Re: LogFile Management