无法编辑postgresql.conf文件以更改设置

时间:2019-07-01 08:26:57

标签: postgresql logging postgresql.conf

在编辑postgresql.conf文件并重新启动服务器之后,似乎所有更改均不适用。

我正在关注本教程: https://dba.stackexchange.com/questions/153904/pgadmin-4-server-status-view-log-file?newreg=9500cbcc4a794d2fbfd6ef5bb787e0e5 为postgresql数据库创建.csv日志文件。在PGAdmin 4中,我已经运行

 SELECT sourcefile FROM pg_settings

SHOW config_file

向我显示了conf文件的路径:/etc/postgresql/10/main/postgresql.conf 我已经通过午夜指挥官在Debian服务器上找到并编辑了该文件,并更改了行:

log_destination='csvlog'
logging_collector='on'
log_directory ='log'
log_filename='postgresql.log'

然后我重新启动服务器

sudo service postgresql restart

现在我遇到了问题。我在.csv目录中找不到应该保存在服务器上的log日志。 /etc/postgresql/10/main或var /lib/postgresql/10/main中没有这样的目录。我唯一能找到的日志在var / log / posgresql上,但是我没有要搜索的.csv文件。另外,我不确定postgresql.conf文件中的任何编辑是否还能正常工作,因为我检查了pgAdmin的设置,这就是我得到的:

SHOW log_destination
stderr

SHOW logging_collector
off

因此看来postgresql.conf中的设置未正确应用。如何为Postgresql正确设置.csv日志以及在何处可以找到它们?

0 个答案:

没有答案