Error in reading Postgres log by pgfouine.php

2019-08-26 08:32发布

I have Postgres configuration with LOGFILE defined in the bash script /etc/rc.d/init.d/postgresql by the option -l ${LOGFILE}

Log gives the following output :

2013-06-07 11:28:18 EDT rentgrowLOG: statement: select count(*) from (select * from results limit 1) test
2013-06-07 11:28:18 EDT rentgrowLOG: duration: 0.333 ms

This output is not readable by pgfouine.php – the error is: “pgFouine did not find any valid PostgreSQL log line in your log file:”

I found also that my changes in postgresql.conf do not affect the output at all.

How prepare a Postgres log file readable by pgfouine.php?

1条回答
贼婆χ
2楼-- · 2019-08-26 09:30

I found also that my changes in postgresql.conf do not affect the output at all.

That's probably the source of the problem. Your log_line_prefix is being ignored. Otherwise, with the prefix set to '%t [%p]: [%l-1] ' as recommended by pgFouine, the log entries would look like this:

2013-06-13 16:38:18 CEST [6203]: [2-1] LOG:  duration: 0.169 ms  statement: select 1;

As to the question: why are the changes to postgresql.conf being ignored? Some typical reasons would be:

  1. Not reloading it after the change, by sending SIGHUP to the postmaster, either directly or through the pg_ctl or service commands.
  2. Editing the wrong file. See: Where are my postgres *.conf files?
查看更多
登录 后发表回答