如何查看postgresql日志存放路徑-創(chuàng)新互聯(lián)

創(chuàng)新互聯(lián)www.cdcxhl.cn八線動(dòng)態(tài)BGP香港云服務(wù)器提供商,新人活動(dòng)買多久送多久,劃算不套路!

創(chuàng)新互聯(lián)公司專業(yè)IDC數(shù)據(jù)服務(wù)器托管提供商,專業(yè)提供成都服務(wù)器托管,服務(wù)器租用,綿陽服務(wù)器托管,綿陽服務(wù)器托管,成都多線服務(wù)器托管等服務(wù)器托管服務(wù)。

這篇文章主要介紹如何查看postgresql日志存放路徑,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!

PostgreSQL有3種日志:

1)pg_log(數(shù)據(jù)庫運(yùn)行日志)內(nèi)容可讀,默認(rèn)關(guān)閉的,需要設(shè)置參數(shù)啟動(dòng)

2)pg_xlog(WAL 日志,即重做日志) 內(nèi)容一般不具有可讀性,強(qiáng)制開啟

3)pg_clog(事務(wù)提交日志,記錄的是事務(wù)的元數(shù)據(jù))  內(nèi)容一般不具有可讀性,強(qiáng)制開啟

pg_xlog和pg_clog一般是在$PGDATA/下面的文件夾下,pg_log默認(rèn)路徑是$PGDATA/pg_log,通??勺远x路徑和文件名。

[root@pg ~]# cd /home/pgsql/9.1/data/
You have mail in /var/spool/mail/root
[root@pg data]# ll
total 460
drwx------ 19 postgres postgres   4096 Nov 27 17:58 base
drwx------  2 postgres postgres   4096 Jan 13 18:58 global
drwx------  2 postgres postgres   4096 Jan 14 02:36 pg_clog     --clog
-rw-------  1 postgres postgres   3513 Dec  4 09:36 pg_hba.conf
-rw-------  1 postgres postgres   1636 Mar 31  2015 pg_ident.conf
drwx------  2 postgres postgres   4096 Jan 14 04:35 pg_log         --log
drwx------  4 postgres postgres   4096 Mar 31  2015 pg_multixact
drwx------  2 postgres postgres   4096 Dec 10 10:37 pg_notify
drwx------  2 postgres postgres   4096 Mar 31  2015 pg_serial
drwx------  2 postgres postgres   4096 Jan 14 10:23 pg_stat_tmp
drwx------  2 postgres postgres  20480 Jan 14 09:56 pg_subtrans
drwx------  3 postgres postgres   4096 Mar 31  2015 pg_tblspc
drwx------  2 postgres postgres   4096 Mar 31  2015 pg_twophase
-rw-------  1 postgres postgres      4 Mar 31  2015 PG_VERSION
drwx------  3 postgres postgres 360448 Jan 14 10:17 pg_xlog     --xlog
-rw-------  1 postgres postgres  19278 Jan  7 11:13 postgresql.conf
-rw-------  1 postgres postgres     56 Dec  4 09:39 postmaster.opts
-rw-------  1 postgres postgres     70 Dec 10 10:37 postmaster.pid
-rw-r--r--  1 postgres postgres    434 Mar 31  2015 serverlog


[postgres@pg data]$ more postgresql.conf
log_destination = 'stderr'               
logging_collector = on
log_directory = 'pg_log'                   ---可自定義路徑
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'   ---日志文件名
log_line_prefix = '%t-%d-%h-%a :'          ---日志每行的標(biāo)準(zhǔn)格式

以上是如何查看postgresql日志存放路徑的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對大家有幫助,更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道!

文章名稱:如何查看postgresql日志存放路徑-創(chuàng)新互聯(lián)
網(wǎng)站鏈接:http://muchs.cn/article42/dpegec.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供品牌網(wǎng)站建設(shè)、全網(wǎng)營銷推廣網(wǎng)站營銷、網(wǎng)站設(shè)計(jì)、微信公眾號ChatGPT

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管