Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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?

share|improve this question
1  
Well, that's job for the windows event log. – Milen A. Radev Feb 26 '14 at 20:22
up vote 8 down vote accepted

There's a chicken-and-egg problem there.

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.