如何记录PostgreSQL查询?

编程入门 行业动态 更新时间:2024-10-25 13:26:20
本文介绍了如何记录PostgreSQL查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何启用由PostgreSQL 8.3执行的所有SQL的日志记录?

How to enable logging of all SQL executed by PostgreSQL 8.3?

已编辑(更多信息) 我更改了这些行:

log_directory = 'pg_log' log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' log_statement = 'all'

然后重新启动PostgreSQL服务...但是没有创建日志... 我正在使用Windows Server 2003.

And restart PostgreSQL service... but no log was created... I'm using Windows Server 2003.

有什么想法吗?

推荐答案

在您的data/postgresql.conf文件中,将log_statement设置更改为'all'.

In your data/postgresql.conf file, change the log_statement setting to 'all'.

修改

查看您的新信息,我想说可能还有其他设置需要验证:

Looking at your new information, I'd say there may be a few other settings to verify:

  • 确保已打开log_destination变量
  • 确保打开logging_collector
  • 还请确保log_directory目录中已经存在log_directory目录,并且postgres用户可以对其进行写入.
  • make sure you have turned on the log_destination variable
  • make sure you turn on the logging_collector
  • also make sure that the log_directory directory already exists inside of the data directory, and that the postgres user can write to it.

更多推荐

如何记录PostgreSQL查询?

本文发布于:2023-10-19 14:57:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1507865.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:PostgreSQL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!