Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

PostgreSQL Parameters to enable Log for all Queries

A database log is necessary for finding different statuses, errors, bad queries and any changes on the Database Server.
A Database Administrator can also log different executed queries and analyze those for performance tuning.
Following are few relevant parameters for enabling the PostgreSQL log for all the queries.
Please open your postgresql.conf file and make sure about all logs related parameter’s value which are mentioned below.
  • log_directory = ‘pg_log’ (default directory name)
  • log_filename = ‘postgresql-%Y-%m-%d_%H%M%S.log’ (default file name structure)
  • log_statement = ‘all’ (value ‘all’ is recommended {none, ddl, mod, all})
  • logging_collector = ON
  • log_line_prefix = ‘%t %c %u ‘ (time, sessionid, user)
  • log_destination = ON (stderr,syslog,csvlog,eventlog)
  • log_rotation_size = 15MB
  • log_rotation_age = 1d (create new log file every day)


Popular posts from this blog

PostgreSQL Database startup / shutdown /restart

How to Get Table Size, Database Size, Indexes Size, schema Size, Tablespace Size, column Size in PostgreSQL Database

2017 Shortern URL - Other Website Like ADFOC.US

ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated ORA-01262: Stat failed on a file destination directory Linux-x86_64 Error: 2: No such file or directory

PostgreSQL Pgbadger Installation On Linux