我编辑了postgresql.conf文件并设置了日志参数,如下所示。但是,在重新启动并查看logging_collector值之后,将其设置为off,并且日志记录无法工作:
log_destination = 'csvlog'
logging_collector = on
log_directory = 'log'
log_filename = 'postgresql-%Y-%m-%d.log'
log_rotation_age = 1d
log_rotation_size = 100MB
log_truncate_on_rotation = on
select * from pg_settings where name like 'log%'
"log_autovacuum_min_duration" "-1"
"log_checkpoints" "off"
"log_connections" "on"
"log_destination" "csvlog"
"log_directory" "log"
"log_disconnections" "off"
"log_duration" "off"
"log_error_verbosity" "default"
"log_executor_stats" "off"
"log_file_mode" "0640"
"log_filename" "postgresql-%Y-%m-%d.log"
"log_hostname" "off"
"log_line_prefix" "%m [%p] "
"log_lock_waits" "off"
"log_min_duration_sample" "-1"
"log_min_duration_statement" "-1"
"log_min_error_statement" "error"
"log_min_messages" "warning"
"log_parameter_max_length" "-1"
"log_parameter_max_length_on_error" "0"
"log_parser_stats" "off"
"log_planner_stats" "off"
"log_recovery_conflict_waits" "off"
"log_replication_commands" "off"
"log_rotation_age" "1440"
"log_rotation_size" "102400"
"log_statement" "none"
"log_statement_sample_rate" "1"
"log_statement_stats" "off"
"log_temp_files" "-1"
"log_timezone" "America/Chicago"
"log_transaction_sample_rate" "0"
"log_truncate_on_rotation" "on"
**"logging_collector" "off"**
"logical_decoding_work_mem" "65536"发布于 2023-06-01 06:40:53
要么您编辑了错误的文件,要么您重新启动了错误的服务器,或者该设置在其他地方被重写。通过查看pg_settings,您得到了正确的想法,但是您看错了列:
SELECT setting, source, sourcefile, sourceline, pending_restart
FROM pg_settings
WHERE name = 'logging_collector';https://dba.stackexchange.com/questions/327739
复制相似问题