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

Ora2PG - Oracle/MySQL to Postgres DB migration Version 20.0

spfile and pfile errors

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

How to Return a Result Set from a PostgreSQL Stored Procedure

PostgreSQL New version upgrade