↑↓ select↵ open⌫ change scopeOpen full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Wiki / Configuration Parameters

log_file_mode

On Unix systems this parameter sets the permissions for log files when logging_collector is enabled. (On Microsoft Windows this parameter is ignored.) The parameter value is expected to be a numeric mode specified in the format accepted by the chmod and umask system calls. (To use the customary octal format the number must start with a 0 (zero).) The default permissions are 0600, meaning only the server owner can read or write the log files. The other commonly useful setting is 0640, allowing members of the owner's group to read the files. Note however that to make use of such a setting, you'll need to alter log_directory to store the files somewhere outside the cluster data directory. In any case, it's unwise to make the log files world-readable, since they might contain sensitive data. This parameter can only be set in the postgresql.conf file or on the server command line.

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
384
category
Reporting and Logging / Where to Log
context
sighup
doc same as
Unknown
documented
true
enumvals
Unknown
extra desc
The parameter value is expected to be a numeric mode specification in the form accepted by the chmod and umask system calls. (To use the customary octal format the number must start with a 0 (zero).)
lang
en
max val
511
metadata version
18
min val
0
name
log_file_mode
short desc
Sets the file permissions for log files.
source
pg-settings-source-snapshot
unit
Unknown
vartype
integer

Definition PG 18

On Unix systems this parameter sets the permissions for log files when logging_collector is enabled. (On Microsoft Windows this parameter is ignored.) The parameter value is expected to be a numeric mode specified in the format accepted by the chmod and umask system calls. (To use the customary octal format the number must start with a 0 (zero).)

The default permissions are 0600, meaning only the server owner can read or write the log files. The other commonly useful setting is 0640, allowing members of the owner's group to read the files. Note however that to make use of such a setting, you'll need to alter log_directory to store the files somewhere outside the cluster data directory. In any case, it's unwise to make the log files world-readable, since they might contain sensitive data.

This parameter can only be set in the postgresql.conf file or on the server command line.

Compare versions

Complete source facts

doc html

<p>
        On Unix systems this parameter sets the permissions for log files
        when <code class="varname">logging_collector</code> is enabled. (On Microsoft
        Windows this parameter is ignored.)
        The parameter value is expected to be a numeric mode
        specified in the format accepted by the
        <code class="function">chmod</code> and <code class="function">umask</code>
        system calls.  (To use the customary octal format the number
        must start with a <code class="literal">0</code> (zero).)
       </p><p>
        The default permissions are <code class="literal">0600</code>, meaning only the
        server owner can read or write the log files.  The other commonly
        useful setting is <code class="literal">0640</code>, allowing members of the owner's
        group to read the files.  Note however that to make use of such a
        setting, you'll need to alter <a class="xref" href="/docs/18/runtime-config-logging.html#GUC-LOG-DIRECTORY">log_directory</a> to
        store the files somewhere outside the cluster data directory.  In
        any case, it's unwise to make the log files world-readable, since
        they might contain sensitive data.
       </p><p>
        This parameter can only be set in the <code class="filename">postgresql.conf</code>
        file or on the server command line.
       </p>

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:6e076fe6b369a8701ae00a9ea5fe3d84dd0cb62cc8b1e5e8660c6fcc2efdbb18

Text language: en · wiki-repair-20261023:6e076fe6b369a8701ae00a9ea5fe3d84dd0cb62cc8b1e5e8660c6fcc2efdbb18