patternsqlModerate
Logging Postgres startup errors on Windows
Viewed 0 times
loggingpostgreswindowserrorsstartup
Problem
I have been experimenting with Postgres configuration parameters and noticed that when I use settings that prevent Postgres from starting nothing shows up in the pg_log directory logs. I have
Is there a way to cause Postgres to log startup errors to pg_log on Windows 7 and Postgres 9.3?
log_destination = 'stderr'
logging_collector = on
log_directory = 'pg_log'Is there a way to cause Postgres to log startup errors to pg_log on Windows 7 and Postgres 9.3?
Solution
There's a chicken-and-egg problem there.
PostgreSQL reads
So it cannot really log errors in
Instead, it uses the Windows Event Log, which is what Windows applications are supposed to do anyway. (You can have PostgreSQL write all logs to the Windows Event Log if you prefer, by changing its logging configuration).
So you should look in the windows event log - see the Event Viewer - for startup issues with PostgreSQL.
PostgreSQL reads
postgresql.conf to decide where to log, and how.So it cannot really log errors in
postgresql.conf to the PostgreSQL logs, unless it uses some kind of fallback/default log.Instead, it uses the Windows Event Log, which is what Windows applications are supposed to do anyway. (You can have PostgreSQL write all logs to the Windows Event Log if you prefer, by changing its logging configuration).
So you should look in the windows event log - see the Event Viewer - for startup issues with PostgreSQL.
Context
StackExchange Database Administrators Q#59735, answer score: 11
Revisions (0)
No revisions yet.