pg_syslog

pg_syslog — read PostgreSQL syslogger output from a named pipe and write it to a file

Synopsis

pg_syslog option... fifo

Description

pg_syslog opens the specified named pipe (fifo) for reading, reads the stream of log messages from it and writes it to a file specified in the configuration file. If the writing end of the pipe gets closed (typically due to the server shutdown or restart), the application keeps trying to open it and read from it again. (Otherwise the server would get stuck during restart.)

The pg_syslog application can send its own messages to the standard output and standard error streams. Make sure these are redirected to a file if you run the application on background. (Unless you are using the nohup utility, which takes care of these streams.)

Please see the documentation of the log_filename configuration variable for more information on sending the log messages to a named pipe.

Options

-c file

Specifies path to the configuration file. The file syntax is the same as the syntax of the postgresql.conf file, however only the following parameters are accepted: log_directory, log_filename, log_file_mode, log_rotation_age, log_rotation_size and log_truncate_on_rotation.

Note

Unlike the PostgreSQL syslogger, which considers the log directory (relative to the data directory) to be the default value of log_directory, for the pg_syslog application the default value is the current directory.

Note

The pg_syslog does not recognize the log_timezone parameter. Instead, it uses the operating system time zone to generate file names and to compute the file rotation times.

The configuration file is reread whenever the pg_syslog process receives a SIGHUP signal.