Error Reporting and Logging

5.6.1. Where To Log

log_destination ( string )

Pgpool-II supports two destinations for logging the Pgpool-II messages. The supported log destinations are stderr and syslog . You can also set this parameter to a list of desired log destinations separated by commas if you want the log messages on the multiple destinations.

       #for example to log on both syslog and stderr
       log_destination = 'syslog,stderr'
      

The default is to log to stderr only.

Note: On some systems you will need to alter the configuration of your system's syslog daemon in order to make use of the syslog option for log_destination . Pgpool-II can log to syslog facilities LOCAL0 through LOCAL7 (see syslog_facility ), but the default syslog configuration on most platforms will discard all such messages. You will need to add something like:

	 local0.*    /var/log/pgpool.log
	

to the syslog daemon's configuration file to make it work.

This parameter can be changed by reloading the Pgpool-II configurations.

syslog_facility ( enum )

See also the documentation of your system's syslog daemon. When logging to syslog is enabled, this parameter determines the syslog "facility" to be used. You can choose from LOCAL0 , LOCAL1 , LOCAL2 , LOCAL3 , LOCAL4 , LOCAL5 , LOCAL6 , LOCAL7 ; the default is LOCAL0 . See also the documentation of your system's syslog daemon.

This parameter can be changed by reloading the Pgpool-II configurations.

syslog_ident ( string )

When logging to syslog is enabled, this parameter determines the program name used to identify Pgpool-II messages in syslog logs. The default is pgpool .

This parameter can be changed by reloading the Pgpool-II configurations.

5.6.2. When To Log

client_min_messages ( enum )

Controls which minimum message levels are sent to the client. Valid values are DEBUG5 , DEBUG4 , DEBUG3 , DEBUG2 , DEBUG1 , LOG , NOTICE , WARNING and ERROR . Each level includes all the levels that follow it. The default is NOTICE .

This parameter can be changed by reloading the Pgpool-II configurations. You can also use PGPOOL SET command to alter the value of this parameter for a current session.

log_min_messages ( enum )

The default is WARNING. Controls which minimum message levels are emitted to log. Valid values are DEBUG5 , DEBUG4 , DEBUG3 , DEBUG2 , DEBUG1 , INFO , NOTICE , WARNING , ERROR , LOG , FATAL , and PANIC . Each level includes all the levels that follow it. The default is WARNING .

This parameter can be changed by reloading the Pgpool-II configurations. You can also use PGPOOL SET command to alter the value of this parameter for a current session.

5.6.3. What To Log

log_statement ( boolean )

Setting to on, prints all SQL statements to the log.

This parameter can be changed by reloading the Pgpool-II configurations. You can also use PGPOOL SET command to alter the value of this parameter for a current session.

log_per_node_statement ( boolean )

Similar to log_statement , except that it print the logs for each DB node separately. It can be useful to make sure that replication or load-balancing is working.

This parameter can be changed by reloading the Pgpool-II configurations. You can also use PGPOOL SET command to alter the value of this parameter for a current session.

log_client_messages ( boolean )

Setting to on, prints client messages to the log.

This parameter can be changed by reloading the Pgpool-II configurations. You can also use PGPOOL SET command to alter the value of this parameter for a current session.

log_hostname ( boolean )

Setting to on, prints the hostname instead of IP address in the ps command result, and connection logs (when log_connections is on).

This parameter can be changed by reloading the Pgpool-II configurations.

log_connections ( boolean )

Setting to on, prints all client connections from to the log.

This parameter can be changed by reloading the Pgpool-II configurations.

log_error_verbosity ( enum )

Controls the amount of detail emitted for each message that is logged. Valid values are TERSE , DEFAULT , and VERBOSE , each adding more fields to displayed messages. TERSE excludes the logging of DETAIL , HINT , and CONTEXT error information.

This parameter can be changed by reloading the Pgpool-II configurations. You can also use PGPOOL SET command to alter the value of this parameter for a current session.

log_line_prefix ( string )

This is a printf -style string that is output at the beginning of each log line. % characters begin "escape sequences" that are replaced with information outlined below. All unrecognized escapes are ignored. Other characters are copied straight to the log line. Default is '%t: pid %p: ', which prints timestamp and process id, which keeps backward compatibility with pre Pgpool-II V3.4 .

Table 5-5. log_line_prefix escape options

Escape Effect
%a Client application name
%p Process ID (PID)
%P Process name
%t Time stamp
%d Database name
%u User name
%l Log line number for each process
%% '%' character

This parameter can be changed by reloading the Pgpool-II configurations.