1

I installed postgres 10.2 with brew on mac

My postgres.conf is

log_destination = 'stderr' logging_collector = off log_statement = 'all'

I started it as blow

pg_ctl -D /usr/local/var/postgres start

However I cannot find the logs at /usr/local/var/log/postgres.log or somewhere else.

Any help?

1

1 Answer 1

3

If you didn't change log_directory from the default, the logs should be in /usr/local/var/postgres/log (on PostgreSQL versions before v10, it is pg_log rather than log).

But since you set logging_collector = off, the log is not redirected from standard error. You should change that setting.

Note that some distributions manage logging by starting PostgreSQL with pg_ctl -l <logfile> rather than setting logging_collector = on; examine the startup script for details.

Sign up to request clarification or add additional context in comments.

12 Comments

But I have the same setting (log_destination = 'stderr' and logging_collector = off) on Ubuntu and I have /var/log/postgresql/postgresql-10-main.log. Any idea why?
I turned on logging_collector and did not change log_directory and I got my log at /usr/local/var/postgres/pg_log/postgresql-2018-02-21_133408.log, but not /usr/local/var/postgres/logs. Any idea?
Yes -- that is because you are using a PostgreSQL version older than v10.
The postgres on ubuntu is v10.1. The one on mac is 10.2
The default value for log_directory is pg_log. I don't see /usr/local/var/postgres/logs in postgresql.conf. Any idea?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.