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. mysql_表_操作

    1.创建表 # 基本语法: create table 表名( 列名 类型 是否可以为空 默认值 自增 主键, 列名 类型 是否可以为空 )ENGINE=InnoDB DEFAULT CHARSET=u ...

  2. SpringBoot整合Dubbo报错: java.lang.ClassCastException

    com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote proxy method queryGoodsLimitPage to regi ...

  3. coursera 《现代操作系统》 -- 第九周 文件系统(1)

    文件的定义 文件名-> 路径名 磁盘结构 磁臂转还是那根柱子转? 盘片被轴带动旋转,磁头读取经过的扇区的数据. 典型的磁盘结构 一块盘呢由若干个盘片组成 每个盘片呢实际上有两个面啊,两个盘面 每 ...

  4. js split 的用法和定义 js split分割字符串成数组的实例代码

    关于js split的用法,我们经常用来将字符串分割为数组方便后续操作,今天写一段广告判断代码的时候,竟然忘了split的用法了,特整理下,方便需要的朋友, 关于js split的用法其它也不多说什么 ...

  5. 让vs只启动自己想调试的站点

    VS中里面多个WEB项目如何只启动一个? 每次启动时,右下角都会出现一堆的 网站有10来个.即使设置了默认启动项目, 但每次按F5启动,或者哪怕是在项目上右键启动新实例 右下角都会出现这一堆的站点 有 ...

  6. String研究

    =======================String=================================== String里的==和equalsJava String “equal ...

  7. Django 之 权限系统(组件)

    参考: http://www.cnblogs.com/yuanchenqi/articles/7609586.html

  8. 【AWS】AWS云计算赋能数字化转型专题研讨会圆满落幕

    大会精彩回顾:查看原文 大会使用的PPT下载地址:点击下载

  9. 佳能相机操作 EDSDK 教程 C# 版本

    http://blog.csdn.net/zajin/article/details/17021339    介绍 佳能EOS数码SDK是一个 可以用来远程控制其数码单反相机相当强大的SDK.不幸的是 ...

  10. iframe与父窗口之间数据互相获取

    Js/Jquery获取iframe中的元素 博客分类: jquery javascript jquery  在web开发中,经常会用到iframe,难免会碰到需要在父窗口中使用iframe中的元素.或 ...