如何在PostgreSQL 9.1中使用pgFouine?

5

使用 pgFouine 1.2 版本和 PostgreSQL 9.1.3 版本。

postgresql.conf 设置:

log_min_duration_statement = 0
log_duration = on
log_line_prefix = '%t [%p]: [%l-1] '
log_statement = 'all'
lc_messages = 'C'           # locale for system error message strings
lc_monetary = 'C'           # locale for monetary formatting
lc_numeric = 'C'            # locale for number formatting
lc_time = 'C'               # locale for time formatting

运行pgFouine时遇到的错误:

C:\Users\Razvan\Desktop\pgfouine-1.2>php pgfouine.php -file log > report.html

请注意,保留了HTML标签。

pgFouine did not find any valid PostgreSQL log line in your log file:
* check that PostgreSQL uses an english locale for logging (lc_messages in your postgresql.conf),
* check that you use the -logtype option (syslog, stderr) according to your log file,
* if you use syslog and log_line_prefix, check that your log_line_prefix has a trailing space,
* if you use stderr, check that your log_line_prefix is of the form '%t [%p]: [%l-1] '.
If you think your log file and your options are correct, please contact the author (gsmet on #postgresql@freenode or guillaume-pg at smet dot org).

我正在使用位于C:\Program Files\PostgreSQL\9.1\data\pg_log的日志文件。

我尝试了各种设置,但没有任何作用,也在互联网上找不到解决方案。

感谢您的帮助!


你能展示一下你的日志文件的前几行吗? - Daniel Vérité
@DanielVérité:这是日志文件开头的几行: http://paste2.org/p/2027616 - Răzvan Flavius Panda
1个回答

6

尝试添加logtype选项:

pgfouine -logtype stderr -file filename

我应该把上述代码放在哪里?日志文件还是postgresql.conf文件中? - Jay
@Jay:这是您在shell解释器中键入的命令。请参阅pgfouine文档。 - Daniel Vérité
我现在在命令提示符中使用的命令是php pgfouine.php -file /postgresql/data/pg_log/postgresql-2014-06-24_083518.log > jtest.html,我应该如何更改它? - Jay
@Jay:你想要提出一个新问题,解释一下你的情况。 - Daniel Vérité

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接