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. AngularJS定时器任务

    由于项目需要监测用户在线时长,所以用定时器来实现. /*计算在线时长,一分钟执行一次*/ var stopEvent = $interval(function(){ //每分钟执行一次定时任务 $sc ...

  2. 2015-03-06——ajax基础

    IE6  必须使用Microsoft.XMLHTTP ActiveX组件来实例化一个对象 IE7已实现了XMLHttpRequest对象 var request = new ActiveXObject ...

  3. Win7环境下Apache+mod_wsgi本地部署Django

    django基础已经掌握的同学可以尝试将项目发布已寻找些许成就感,以鼓励自己接下来进行django的进阶学习 以前你总是使用python manage.py runserver进行服务启动,但是却不知 ...

  4. RecyclerView添加分割线

    mRecyclerView = findView(R.id.id_recyclerview); //设置布局管理器 mRecyclerView.setLayoutManager(layout); // ...

  5. 剑指offer 面试5题

    面试5题: 题目:请实现一个函数,将一个字符串中的空格替换成“%20”.例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy. 方法一: # -*- co ...

  6. 【转】Python max内置函数详细介绍

    #max() array1 = range(10) array2 = range(0, 20, 3) print('max(array1)=', max(array1)) print('max(arr ...

  7. Django基础(三)_分页器、COOKIE与SESSION、FORM表单

    分页器(paginator) 分页器的使用 >>> from django.core.paginator import Paginator >>> objects ...

  8. SQL SREVER, ORACLE数据库连接字符串

    采用windows身份验证模式 Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI;

  9. Vue:实践学习笔记(3)——组件使用

    Vue:实践学习笔记(3)——组件使用 全局注册 1.注册组件 Vue.component('my-component',{ //选项 }) 说明:my-component就是注册的组件自定义的标签名 ...

  10. jQuery:自学笔记(3)——操作DOM

    jQuery:自学笔记(3)——操作DOM 修改元素的属性 获取元素属性 设置元素属性 修改元素的内容 说明 有三种方式可以获取HTML元素的内容,分别是 ☐ text():设置或返回所选元素的文本内 ...