在阅读Postgres的错误日志由pgfouine.php [英] Error in reading Postgres log by pgfouine.php

查看:233
本文介绍了在阅读Postgres的错误日志由pgfouine.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有由选项-l $ {LOGFILE}在bash脚本 /etc/rc.d/init.d/postgresql 定义LOGFILE

日志提供了以下的输出:


  

2013年6月7日11点28分18秒EDT rentgrowLOG:语句:SELECT COUNT(*)FROM
  (SELECT * FROM结果限制1)测试结果
  2013年6月7日11时28分18秒EDT
  rentgrowLOG:时间:0.333毫秒


这输出不受pgfouine.php可读 - 错误的是:
 pgFouine没有找到任何有效的PostgreSQL日志行的日志文件:

我也发现,我的postgresql.conf中的变化不会影响输出的。

如何prepare一个Postgres日志文件可读pgfouine.php?


解决方案

  

我也发现我在postgresql.conf里的变化不影响
  输出的。


这可能是问题的根源。你的 log_line_ preFIX 被忽略。否则,将preFIX设置为'%T [%P]:[%L-1] 的建议pgFouine,所有的记录是这样的


2013年6月13日十六点38分18秒CEST [6203]:[2-1] LOG:时间:0.169毫秒声明:选择1;

至于问题:为什么更改的postgresql.conf 被忽略?一些典型的原因是:


  1. 不重装它改变后,通过发送 SIGHUP 来的邮政局长,无论是直接或通过使用pg_ctl 服务命令。

  2. 编辑错误的文件。参见:哪里是我的Postgres * conf文件

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?

解决方案

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?

这篇关于在阅读Postgres的错误日志由pgfouine.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆