Where are Postgresql 9.1 logs? (not starting on FreeBSD 10) Where are Postgresql 9.1 logs? (not starting on FreeBSD 10) postgresql postgresql

Where are Postgresql 9.1 logs? (not starting on FreeBSD 10)


Some versions of FreeBSD ports installed PostgreSQL with syslog logging enabled. You can confirm this by looking at /usr/local/pgsql/data/postgresql.conf for log_destination = 'syslog'

If that is the case, the logging output should be visible in /var/log/messages


Default syslog logging enabled (log_destination = 'syslog') and logging output should be visible in /var/log/messages.

If you want to make a log in a separate file:

1) Create log file:

touch /var/log/postgresql/postgresql.log

2) Edit /etc/syslog.conf, append lines

!postgres*.*                                             /var/log/postgresql/postgresql.log!*

After editing, you need to restart the service

service syslogd restart

4) do not forget to rotate postgresql.log (edit /etc/newsyslog.conf)

5) Perhaps in order to see something you will need to set the logging level. As an example, add to your postgresql.conf

client_min_messages = loglog_min_messages = infolog_checkpoints = onlog_connections = onlog_disconnections = on