PostgreSQL log classification and management
PostgreSQL has three types of logs: pg_log (database operation log), pg_xlog (WAL log, that is, redo log), and pg_clog (transaction commit log, which records the transaction metadata)
Pg_log is disabled by default. You need to set parameters to enable this log. Both pg_xlog and pg_clog are forcibly enabled and cannot be disabled.
1. Enable pg_log and configure Log Parameters
Log_destination = 'svlog'
Logging_collector = on
Log_directory = 'pg _ Log'
Log_filename = 'postgresql-% Y-% m-% d _ % H % M % S. Log'
Log_rotation_age = 1d
Log_rotation_size = 100 MB
Log_min_messages = info
# Record slow SQL statements
Log_min_duration_statement = 60
Log_checkpoints = on
Log_connections = on
Log_disconnections = on
Log_duration = on
Log_line_prefix = '% m'
# Monitoring database lock for a long time
Log_lock_waits = on
# Record DDL operations
Log_statement = 'ddl'
2. Restart PostgreSQL to view new logs under $ PGDATA/pg_log.
Pg_ctl restart-m fast
------------------------------------ Lili split line ------------------------------------
Install the PostgreSQL 9.3.5 database in Ubuntu Server 14.04
Install PostgreSQL 6.3 on yum in CentOS 9.3
PostgreSQL cache details
Compiling PostgreSQL on Windows
Configuration and installation of LAPP (Linux + Apache + PostgreSQL + PHP) Environment in Ubuntu
Install and configure phppgAdmin on Ubuntu
Install PostgreSQL9.3 on CentOS
Configure a Streaming Replication cluster in PostgreSQL
How to install PostgreSQL 7/6 and phpPgAdmin in CentOS 5/6. 4
------------------------------------ Lili split line ------------------------------------
PostgreSQL details: click here
PostgreSQL: click here
This article permanently updates the link address: