0

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?

Daniel Vérité
  • 58,074
  • 15
  • 129
  • 156
Alex
  • 7,007
  • 18
  • 69
  • 114
  • 2
    What's your `log_line_prefix` in `postgresql.conf` and what are the options passed to pgFouine? – Daniel Vérité Jun 07 '13 at 22:09
  • log_line_prefix = '%t [%p]: [%l-1] ' C:\pgf>\wamp\bin\php\php5.3.13\php.exe pgfouine.php -file postgresql-2013-06-07_182652.log -logtype stderr I do not see that changing the options in the config files changes the output. I could not install php on Linux, so I am using windows – Alex Jun 11 '13 at 14:39

1 Answers1

1

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?
Community
  • 1
  • 1
Daniel Vérité
  • 58,074
  • 15
  • 129
  • 156