If <systemitem>csvlog</systemitem> is included in <varname>log_destination</varname>,
log entries are output in <quote>comma-separated
value</quote> (<acronym>CSV</acronym>) format, which is convenient for
loading logs into programs.
See <xref linkend="runtime-config-logging-csvlog"/> for details.
<xref linkend="guc-logging-collector"/> must be enabled to generate
CSV-format log output.
</para>
<para>
If <systemitem>jsonlog</systemitem> is included in
<varname>log_destination</varname>, log entries are output in
<acronym>JSON</acronym> format, which is convenient for loading logs
into programs.
See <xref linkend="runtime-config-logging-jsonlog"/> for details.
<xref linkend="guc-logging-collector"/> must be enabled to generate
JSON-format log output.
</para>
<para>
When either <systemitem>stderr</systemitem>,
<systemitem>csvlog</systemitem> or <systemitem>jsonlog</systemitem> are
included, the file <filename>current_logfiles</filename> is created to
record the location of the log file(s) currently in use by the logging
collector and the associated logging destination. This provides a
convenient way to find the logs currently in use by the instance. Here
is an example of this file's content:
<programlisting>
stderr log/postgresql.log
csvlog log/postgresql.csv
jsonlog log/postgresql.json
</programlisting>
<filename>current_logfiles</filename> is recreated when a new log file
is created as an effect of rotation, and
when <varname>log_destination</varname> is reloaded. It is removed when
none of <systemitem>stderr</systemitem>,
<systemitem>csvlog</systemitem> or <systemitem>jsonlog</systemitem> are
included in <varname>log_destination</varname>, and when the logging
collector is disabled.
</para>
<note>
<para>
On most Unix systems, you will need to alter the configuration of
your system's <application>syslog</application> daemon in order
to make use of the <systemitem>syslog</systemitem> option for
<varname>log_destination</varname>. <productname>PostgreSQL</productname>
can log to <application>syslog</application> facilities
<literal>LOCAL0</literal> through <literal>LOCAL7</literal> (see <xref
linkend="guc-syslog-facility"/>), but the default
<application>syslog</application> configuration on most platforms
will discard all such messages. You will need to add something like:
<programlisting>
local0.* /var/log/postgresql
</programlisting>
to the <application>syslog</application> daemon's configuration file
to make it work.
</para>
<para>
On Windows, when you use the <literal>eventlog</literal>
option for <varname>log_destination</varname>, you should
register an event source and its library with the operating
system so that the Windows Event Viewer can display event
log messages cleanly.
See <xref linkend="event-log-registration"/> for details.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry id="guc-logging-collector" xreflabel="logging_collector">
<term><varname>logging_collector</varname> (<type>boolean</type>)
<indexterm>
<primary><varname>logging_collector</varname> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
This parameter enables the <firstterm>logging collector</firstterm>, which
is a background process that captures log messages
sent to <systemitem>stderr</systemitem> and redirects them into log files.
This approach is often more useful than
logging to <application>syslog</application>, since some types of messages
might