Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Database \ PostgreSQL log classification and management     - How to Install Redis server on CentOS 7 (Server)

- Analysis of Java in the deep copy and shallow copy (Programming)

- Oracle inverted reverse function (Database)

- RedHat command line and graphical interface switching (Linux)

- Sublime Text 3 using summary (Linux)

- Spark On YARN cluster installation deployment (Server)

- PHP interview questions of design patterns (Programming)

- Linux NFS service fixed ports and firewall configuration (Linux)

- Quick Install software RAID on Linux (Linux)

- Linux Monitoring Command (Linux)

- Improve WordPress performance (Server)

- Java memory analysis tool uses detailed MAT (Programming)

- Linux SSH commands (Linux)

- Linux ban single-user mode to enhance system security (Linux)

- Log in CentOS 6.5 Multi-user setting VNC (Server)

- Lua4.0 interpreter entrance (Programming)

- MySQL Installation Troubleshooting (Database)

- Fedora 22 installation and configuration optimization (Linux)

- Android custom title bar (Programming)

- Android use canvas board painting (Programming)

  PostgreSQL log classification and management
  Add Date : 2018-11-21      
  PostgreSQL has three kinds of logs are pg_log (database running log), pg_xlog (WAL log, that redo logs), pg_clog (transaction commit log record of the transaction metadata)

pg_log is off by default, need to set the parameters to enable this log. pg_xlog and pg_clog are forced open, not close.

1. Enable and configure logging parameters pg_log
log_destination = 'csvlog'
  logging_collector = on
  log_directory = 'pg_log'
  log_filename = 'postgresql-% Y-% m-% d_% H% M% S.log'
  log_rotation_age = 1d
  log_rotation_size = 100MB
  log_min_messages = info
  # Record slow SQL execution
  log_min_duration_statement = 60
  log_checkpoints = on
  log_connections = on
  log_disconnections = on
  log_duration = on
  log_line_prefix = '% m'
  # Monitoring database long locks
log_lock_waits = on
  # Record DDL operations
log_statement = 'ddl'

2. Restart PostgreSQL to see the newly generated log $ PGDATA / pg_log / under.
pg_ctl restart -m fast
- Using VMware vSphere Client Linux virtual machine installation CentOS6.4 system (Linux)
- RHEL6.5 replace local YUM source (Linux)
- Spark local development environment to build (Server)
- GRUB how to load Linux kernel (Linux)
- Using shell users or virtual users to login to pureftpd (Linux)
- tar command to extract a file error: stdin has more than one entry (Linux)
- Cacti installation deployment under CentOS 6.6 (Server)
- Fedora 20, Fedora 19, CentOS 6 and RHEL6 users how to install Wine 1.7.15 (Linux)
- Which file system is most suitable for your Linux system (Linux)
- SSH service configuration to use a certificate login Linux server (Server)
- Java reflection by calling the class method (Programming)
- How to install Linux on a MacBook Pro Retina (Linux)
- CentOS7 install JAVA notes (Linux)
- findmnt- Looking mounted file system (Linux)
- Java factory pattern (Factory mode) (Programming)
- Linux environment MySQL master-slave synchronization (Database)
- Build a Linux development environment under STC89C52RC (Linux)
- Number JavaScript type system (Programming)
- How to install and use the malware detection tool LMD and ClamAV antivirus engine on Linux (Linux)
- About Hibernate cache, you want the latest data have trouble even session.clear (Database)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.