1

I'm new to Postgres so can't seem to change the logging setting.

At the moment it logs ALL queries that are executed by any application. The app writes millions of queries a day so the log files get too big. I only need it to log any errors.

How can I change that in Postgres? I've installed it using Homebrew on Mac OS X.

Vivek S.
  • 19,945
  • 7
  • 68
  • 85
Jacob
  • 6,317
  • 10
  • 40
  • 58

2 Answers2

3

You need to configure in postgresql.conf(data/postgresql.conf) file

change the setting in log_statement = 'all' to get the desired value which is available in When To Log

see this SO question for more info.

Vivek S.
  • 19,945
  • 7
  • 68
  • 85
  • My configuration already seems to be set to `log_statement='none'` yet is still logging all queries. – Jacob Mar 12 '15 at 06:20
  • just go through http://stackoverflow.com/questions/722221/how-to-log-postgresql-queries you'll get more details about logging – Vivek S. Mar 12 '15 at 06:26
0

@jacob You can restart the postgresql service by sudo /etc/init.d/postgresql restart or sudo service postgresql restart.

sudalai mani
  • 1
  • 1
  • 2