Having built Postgres 11.1 on my FreeBSD 11.2 machine, where might I find the logs output from Postgres.
Specifically, when attempting to start Postgres for the first time, I get an error message from pg_ctl
telling me to example the logs for an explanation of the problem.
$ /usr/local/bin/pg_ctl -D /var/db/postgres/data11 -l logfile start
pg_ctl: another server might be running; trying to start server anyway
waiting for server to start.... stopped waiting
pg_ctl: could not start server
Examine the log output.
When building Postgres, the final output mentions:
NB. FreeBSD's PostgreSQL port logs to syslog by default
See ~pgsql/data/postgresql.conf for more info
When I look in that file, the only entry on logging is:
log_destination = 'syslog'
➥ How do I query syslog for my Postgres logs?
First of all, you will have to create a dedicated log file for PostgreSQL:
After that update
/etc/syslog.conf
and redirect messages from PostgreSQL to the log file just created by adding entry like this:Don't forget to restart syslogd to apply your changes: