PostgreSQL的日志文件介绍
2013-07-19 16:07
295 查看
PostgreSQL的日志文件
pg_log:数据库活动日志(也就是数据库的操作日志);
pg_xlog:事务日志;
pg_clog:事务状态日志(pg_clog是pg_xlog的辅助日志)。
现在主要介绍pg_log
pg_log的文件内容是可以自定义的,可以通过命令来定义也可以通过修改配置文件postgresql.conf来定义.
主要需要修改的参数如下,参数修改完毕后重启服务,重新连接数据库,对其操作即可查看日志变化情况。
# - When to Log -
client_min_messages = info
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
log_min_messages = info
#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
log_min_error_statement = info
#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
log_connections = on
log_disconnections = on
#log_duration = off
log_error_verbosity = verbose # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = '%a %u %d %h %t %i %e ' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port(this is a os port)
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
log_statement = 'all' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = 'Asia/Hong_Kong'
pg_log:数据库活动日志(也就是数据库的操作日志);
pg_xlog:事务日志;
pg_clog:事务状态日志(pg_clog是pg_xlog的辅助日志)。
现在主要介绍pg_log
pg_log的文件内容是可以自定义的,可以通过命令来定义也可以通过修改配置文件postgresql.conf来定义.
主要需要修改的参数如下,参数修改完毕后重启服务,重新连接数据库,对其操作即可查看日志变化情况。
# - When to Log -
client_min_messages = info
#client_min_messages = notice # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# log
# notice
# warning
# error
log_min_messages = info
#log_min_messages = warning # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic
log_min_error_statement = info
#log_min_error_statement = error # values in order of decreasing detail:
# debug5
# debug4
# debug3
# debug2
# debug1
# info
# notice
# warning
# error
# log
# fatal
# panic (effectively off)
#log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this number
# of milliseconds
# - What to Log -
#debug_print_parse = off
#debug_print_rewritten = off
#debug_print_plan = off
#debug_pretty_print = on
#log_checkpoints = off
log_connections = on
log_disconnections = on
#log_duration = off
log_error_verbosity = verbose # terse, default, or verbose messages
#log_hostname = off
log_line_prefix = '%a %u %d %h %t %i %e ' # special values:
# %a = application name
# %u = user name
# %d = database name
# %r = remote host and port(this is a os port)
# %h = remote host
# %p = process ID
# %t = timestamp without milliseconds
# %m = timestamp with milliseconds
# %i = command tag
# %e = SQL state
# %c = session ID
# %l = session line number
# %s = session start timestamp
# %v = virtual transaction ID
# %x = transaction ID (0 if none)
# %q = stop here in non-session
# processes
# %% = '%'
# e.g. '<%u%%%d> '
#log_lock_waits = off # log lock waits >= deadlock_timeout
log_statement = 'all' # none, ddl, mod, all
#log_temp_files = -1 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
log_timezone = 'Asia/Hong_Kong'
相关文章推荐
- postgresql9.5.9相关的日志文件介绍
- tomcat中的日志开关文件(logging.properties)介绍
- 本章介绍ubuntu kylin 系统的日志文件
- ubuntu日志文件介绍
- Sql Server 数据库恢复和日志文件的详细介绍
- 介绍一个个人觉得比较好用VC日志文件输出工具
- ubuntu查看系统日志及相关文件介绍
- postgresql 日志中报xlog目录中文件找不到
- postgresql支持SQL语句读取日志文件了
- PostgreSQL 日志文件位置
- 如何对日志文件进行二分查找?开源文件二分查找工具『timecat』介绍
- 简单介绍:Java web保存日志与Android保存日志文件
- 联机重做日志文件组的状态介绍
- Mysql日志文件和日志类型介绍
- 磁盘阵列介绍、进程的查看管理、日志文件的查看分析,systemctl的控制
- PostgreSQL配置文件--日志和错误
- linux 日志文件介绍
- 磁盘阵列介绍、进程的查看管理、日志文件的查看分析,systemctl的控制
- MYSQL日志文件介绍
- Linux日志文件与syslog函数介绍