PostgreSQL log classification and management

Source: Internet
Author: User

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:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.