Wiki / Configuration Parameters
logging_collector
This parameter enables the logging collector, which is a background process that captures log messages sent to stderr and redirects them into log files. This approach is often more useful than logging to syslog, since some types of messages might not appear in syslog output. (One common example is dynamic-linker failure messages; another is error messages produced by scripts such as archive_command.) This parameter can only be set at server start. Note It is possible to log to stderr without using the logging collector; the log messages will just go to wherever the server's stderr is directed. However, that method is only suitable for low log volumes, since it provides no convenient way to rotate log files. Also, on some platforms not using the logging collector can result in lost or garbled log output, because multiple processes writing concurrently to the same log file can overwrite each other's output. Note The logging collector is designed to avoid dropping messages. This means that in case of extremely high load, server processes could be blocked while trying to send additional log messages when the collector has fallen behind. In contrast, syslog prefers to drop messages if it cannot write them, which means it may fail to log some messages in such cases but it will not block the rest of the system. The logging collector does not guarantee that log messages have reached durable storage. It can still lose messages due to a system crash, power loss, or an error while writing the log file.
English manual coverage begins with PostgreSQL 7.4. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- boot val
- off
- category
- Reporting and Logging / Where to Log
- context
- postmaster
- doc same as
- Unknown
- documented
- true
- enumvals
- Unknown
- extra desc
- Unknown
- lang
- en
- max val
- Unknown
- metadata version
- 18
- min val
- Unknown
- name
- logging_collector
- short desc
- Start a subprocess to capture stderr, csvlog and/or jsonlog into log files.
- source
- pg-settings-source-snapshot
- unit
- Unknown
- vartype
- bool
Definition PG 18
This parameter enables the logging collector, which
is a background process that captures log messages
sent to stderr and redirects them into log files.
This approach is often more useful than
logging to syslog, since some types of messages
might not appear in syslog output. (One common
example is dynamic-linker failure messages; another is error messages
produced by scripts such as archive_command.)
This parameter can only be set at server start.
Note
It is possible to log to stderr without using the logging collector; the log messages will just go to wherever the server's stderr is directed. However, that method is only suitable for low log volumes, since it provides no convenient way to rotate log files. Also, on some platforms not using the logging collector can result in lost or garbled log output, because multiple processes writing concurrently to the same log file can overwrite each other's output.
Note
The logging collector is designed to avoid dropping messages. This means that in case of extremely high load, server processes could be blocked while trying to send additional log messages when the collector has fallen behind. In contrast, syslog prefers to drop messages if it cannot write them, which means it may fail to log some messages in such cases but it will not block the rest of the system.
The logging collector does not guarantee that log messages have reached durable storage. It can still lose messages due to a system crash, power loss, or an error while writing the log file.
Compare versions
Complete source facts
doc html
<p>
This parameter enables the <em class="firstterm">logging collector</em>, which
is a background process that captures log messages
sent to <span class="systemitem">stderr</span> and redirects them into log files.
This approach is often more useful than
logging to <span class="application">syslog</span>, since some types of messages
might not appear in <span class="application">syslog</span> output. (One common
example is dynamic-linker failure messages; another is error messages
produced by scripts such as <code class="varname">archive_command</code>.)
This parameter can only be set at server start.
</p><div class="note"><h3 class="title">Note</h3><p>
It is possible to log to <span class="systemitem">stderr</span> without using the
logging collector; the log messages will just go to wherever the
server's <span class="systemitem">stderr</span> is directed. However, that method is
only suitable for low log volumes, since it provides no convenient
way to rotate log files. Also, on some platforms not using the
logging collector can result in lost or garbled log output, because
multiple processes writing concurrently to the same log file can
overwrite each other's output.
</p></div><div class="note"><h3 class="title">Note</h3><p>
The logging collector is designed to avoid dropping messages. This means
that in case of extremely high load, server processes could be
blocked while trying to send additional log messages when the
collector has fallen behind. In contrast, <span class="application">syslog</span>
prefers to drop messages if it cannot write them, which means it
may fail to log some messages in such cases but it will not block
the rest of the system.
</p><p>
The logging collector does not guarantee that log messages have
reached durable storage. It can still lose messages due to a system
crash, power loss, or an error while writing the log file.
</p></div>documentation revision
{"inputs":[{"file":"runtime-config-logging.html","kind":"same-version-reviewed-manual","locale":"en","sha256":"278d913b9c0f735c5cd7b35fd7205826bbd9c449805370d2dbe54105c0ed1d88","version":"18.7"},{"file":"runtime-config-logging.html","kind":"same-version-reviewed-manual","locale":"zh-Hans","sha256":"68c010254e1859ec0b76f06a563babd51a6c38997f1242e35e4c6b649724b1cb","version":"18.7"}],"release":"18.7","runtime_remeasured":false,"source_revision":"pgdoc:b9f0e7232f60f380d642ac9b99226606c254b552"}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · wiki-repair-20261023:3986e50ff41ab53841f9252a9aa40b8ed46ce34909852823bc8554a8db9a40b6
Text language: en · wiki-repair-20261023:3986e50ff41ab53841f9252a9aa40b8ed46ce34909852823bc8554a8db9a40b6