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'

PostgreSQL的日志文件介绍的更多相关文章

  1. 云服务器 ECS Linux 系统中常见的日志文件介绍

    云服务器 ECS Linux 系统中,日志文件是非常重要的文件,它们记录了很多系统中重要的事.Linux 系统中常见日志文件概述如下: /var/log/cron可以在 cron 文件中检查 cron ...

  2. MySQL 各类日志文件介绍

    日志文件 1.错误日志 ErrorLog 错误日志记录了MyQLServer运行过程中所有较为严重的警告和错误信息,以及MySQLServer每次启动和关闭的详细信息. 在默认情况下,系统记录错误日志 ...

  3. Mysql Binlog日志文件介绍

    一.Binlog简介 官方文档参考 https://dev.mysql.com/doc/refman/5.5/en/binary-log.html Binlog(Binary Log) 指数据库的表创 ...

  4. 收缩SQL数据库日志文件

    收缩SQL数据库日志文件 介绍具体的操作方法前,先说下我操作的实际环境和当时的状况.我的服务器是windows server 2008 R2 64位英文版,数据库是SQL server 2008英文版 ...

  5. Linux下重要日志文件及查看方式

    http://os.51cto.com/art/201108/282184_all.htm   1.Linux下重要日志文件介绍 /var/log/boot.log 该文件记录了系统在引导过程中发生的 ...

  6. MySQL提升笔记(3)日志文件详解

    在MySQL数据库和InnoDB存储引擎中,有很多种文件,如:参数文件.日志文件.socket文件.pid文件.MySQL表结构文件.存储引擎文件. 本节重点关注日志文件,MySQL的复制.事务等重要 ...

  7. 深入理解Linux文件系统与日志文件

    目录: 一.inode与block 二.inode内容 三.inode的号码 四.inode的大小 五.链接文件 六.inode节点耗尽故障处理 七.恢复EXT类型的文件编译安装extundelete ...

  8. MySQL各类日志文件相关变量介绍

    文章转自:http://www.ywnds.com/?p=3721 MySQL各类日志文件相关变量介绍 查询所有日志的变量   1 mysql> show global variables li ...

  9. 介绍了Apache日志文件每条数据的请意义以及一些实用日志分析命令

    这篇文章主要介绍了apache日志文件每条数据的请意义,以及一些实用日志分析命令,需要的朋友可以参考下(http://wap.0834jl.com) 一.日志分析 如果apache的安装时采用默认的配 ...

随机推荐

  1. 不恰当使用线程池处理 MQ 消息引起的故障

    现状 业务部门反应网站访问特别慢,负责运维监控的同事说MQ消息队列积压了,中间件的说应用服务器内存占用很高,GC 一直回收不了内存,GC 线程占了近 100% 的 CPU,其他的基本上都在等待,数据库 ...

  2. 学习 Unix 常用命令

    第一个是 man 命令,作用是:"Display system documentation",我是 manual 的缩写.通过这个命令,我们能了解接下来要学习的命令的文档. ls, ...

  3. JavaScript-onerror事件:图片加载失败后不显示

    HTML: <img src="http://www.mazey.net/images/upload/image/20170518/1495122198180663.gif" ...

  4. Vue中获取dom元素

    Vue.js虽然说是数据驱动页面的,但是有时候我们也要获取dom对象进行一些操作. vue的不同版本获取dom对象的方法不一样 Vue.js  1.0版本中,通过v-el绑定,然后通过this.els ...

  5. 我的Android进阶之旅------>ListView中android:cacheColorHint,android:listSelector属性作用 .

    ( 本文转载于:http://blog.csdn.net/stonecao/article/details/6216449) 自定义listview的时候,当你不使用android:cacheColo ...

  6. Oracle学习笔记—常用函数

    这里记录一些oracle常用的函数. TO_NUMBER()函数 将字符串类型转换成一个 number 类型的值. SELECT TO_NUMBER('100.00') FROM DUAL; TO_C ...

  7. spring tiles界面为空白

    Caused by: org.apache.jasper.JasperException: /WEB-INF/views/admin_template.jsp(3,62) Unable to read ...

  8. outlook 设置分类收邮件

    打开outlook,工具---->“规则和通知”.建相应的规则即可.

  9. docker 命令添加容器数据卷

    实现宿主机和容器的数据共享 只要建立连接,即使容器exit,主机的修改仍能提现到容器

  10. Linux用户和用户组管理 用户组管理命令

    添加用户组命令:groupadd 命令格式: [root@localhost ~]# groupadd [选项] 组名 选项: 选项 选项说明 -g GID 指定组ID: 修改用户组命令:groupm ...