log_file_mode
英文手册覆盖始于 PostgreSQL 7.4. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 18·选择有来源记录的版本
- boot val
- 384
- category
- Reporting and Logging / Where to Log
- context
- sighup
- documented
- true
- enumvals
- 未知
- 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
- 未知
- vartype
- integer
版本定义 PG 18
在 Unix 系统上,当logging_collector被启用时,这个参数设置日志文件的权限(在微软 Windows 上这个参数将被忽略)。这个参数值应当是一个数字形式的模式,它可以被chmod和umask系统调用接受(要使用通常的八进制格式,该数字必须以一个0(零)开始)。
默认的权限是0600,表示只有服务器拥有者才能读取或写入日志文件。其他常用的设置是0640,它允许拥有者的组成员读取文件。不过要注意你需要修改log_directory为将文件存储在集簇数据目录之外的某个位置,才能利用这个设置。在任何情况下,让日志文件变成任何人都可读是不明智的,因为日志文件中可能包含敏感数据。
这个参数只能在postgresql.conf文件中或通过服务器命令行进行设置。
比较版本
来源引用
定义来源
center · PostgreSQL 18 · english-manuals:b8d49977e448d46528c72d50c464b47a3e0be6f8eae92a26d98e5acdc84ffc52
正文语言: zh-Hans · 2026-09-11@29c86d9