postgresql日志放在哪里
2023-04-18 14:24:47 时间
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/ 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 :' ---日志每行的标准格式
推荐:PostgreSQL教程
相关文章
- 操作系统核心原理-3.进程原理(上):进程概要
- Jupyter notebook中怎么添加Pytorch运行环境
- 怎么使用Python工厂模式实现封装Webhook群聊机器人
- 基于Python怎么编写一个刷题练习系统
- 关于在异步操作中访问React事件对象的问题
- $.getJSON() 未能执行回调函数的缘由
- [python] 基于diagrams库绘制系统架构图
- [OpenCV实战]40 计算机视觉工具对比
- netty系列之:netty中的Channel详解
- python3参考秘籍-附PDF下载
- 由于不当的执行顺序导致的死锁
- Spring5参考指南:SpringAOP简介
- 自动化网络验证以实现更顺利变更
- 基于 MaxCompute 分布式 Python 能力的大规模数据科学分析
- Flink 1.14 新特性预览
- API网关:第8层网络
- Python 开发人员正在为医疗保健创建颠覆性的 AI 应用程序
- 如何在Python中创建和使用虚拟环境
- 常用的分布式事务都有哪些?我该用哪个?
- 在 Python中处理大型机器学习数据集的简单方法