如何查看postgresql日志存放路径
这篇文章主要介绍如何查看postgresql日志存放路径,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
PostgreSQL有3种日志:
1)pg_log(数据库运行日志)内容可读,默认关闭的,需要设置参数启动
2)pg_xlog(WAL 日志,即重做日志) 内容一般不具有可读性,强制开启
3)pg_clog(事务提交日志,记录的是事务的元数据) 内容一般不具有可读性,强制开启
pg_xlog和pg_clog一般是在$PGDATA/下面的文件夹下,pg_log默认路径是$PGDATA/pg_log,通常可自定义路径和文件名。
[root@pg~]#cd/home/pgsql/9.1/data/Youhavemailin/var/spool/mail/root[root@pgdata]#lltotal460drwx------19postgrespostgres4096Nov2717:58basedrwx------2postgrespostgres4096Jan1318:58globaldrwx------2postgrespostgres4096Jan1402:36pg_clog--clog-rw-------1postgrespostgres3513Dec409:36pg_hba.conf-rw-------1postgrespostgres1636Mar312015pg_ident.confdrwx------2postgrespostgres4096Jan1404:35pg_log--logdrwx------4postgrespostgres4096Mar312015pg_multixactdrwx------2postgrespostgres4096Dec1010:37pg_notifydrwx------2postgrespostgres4096Mar312015pg_serialdrwx------2postgrespostgres4096Jan1410:23pg_stat_tmpdrwx------2postgrespostgres20480Jan1409:56pg_subtransdrwx------3postgrespostgres4096Mar312015pg_tblspcdrwx------2postgrespostgres4096Mar312015pg_twophase-rw-------1postgrespostgres4Mar312015PG_VERSIONdrwx------3postgrespostgres360448Jan1410:17pg_xlog--xlog-rw-------1postgrespostgres19278Jan711:13postgresql.conf-rw-------1postgrespostgres56Dec409:39postmaster.opts-rw-------1postgrespostgres70Dec1010:37postmaster.pid-rw-r--r--1postgrespostgres434Mar312015serverlog[postgres@pgdata]$morepostgresql.conflog_destination='stderr'logging_collector=onlog_directory='pg_log'---可自定义路径log_filename='postgresql-%Y-%m-%d_%H%M%S.log'---日志文件名log_line_prefix='%t-%d-%h-%a:'---日志每行的标准格式
以上是如何查看postgresql日志存放路径的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。