Обсуждение: Logging PostgreSQL output
Hi all, I want to log all PostgreSQL's output in a seperate file. Is it possible to use the syslog system to do that or is the onlyway to use the stdout method? If it is possible to use the syslog system, how should I do this (I have tried severalthings but nothing I tried worked)? Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 e-mail: J.Kraaijeveld@Askesis.nl web: www.askesis.nl
"Joost Kraaijeveld" <J.Kraaijeveld@Askesis.nl> writes: > I want to log all PostgreSQL's output in a seperate file. Is it > possible to use the syslog system to do that or is the only way to use > the stdout method? If it is possible to use the syslog system, how > should I do this (I have tried several things but nothing I tried > worked)? You should be able to configure your syslog daemon to do that; read its man page. regards, tom lane
Hi Gaetano Gaetano Mendola schreef: > ad that "-" char in front of your file location log This remark was what did it (all the other things allready were in place). Thanks. It is in the man pages but just as anommission of file sync flag. Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 e-mail: J.Kraaijeveld@Askesis.nl web: www.askesis.nl
Joost Kraaijeveld wrote: > Hi all, > > I want to log all PostgreSQL's output in a seperate file. Is it possible to use the syslog system to do that or is theonly way to use the stdout method? If it is possible to use the syslog system, how should I do this (I have tried severalthings but nothing I tried worked)? put these lines on your postgresql.conf syslog = 2 syslog_facility = 'LOCAL0' syslog_ident = 'postgres' after this you have to configure your syslogd: add these lines on yout syslog.conf: # Postgres LOCAL0.* -/var/log/postgresql.log not forget to add LOCAL0.none in your /var/log.messages log ad ad that "-" char in front of your file location log now you have to SIGHUP both postgres and syslogd. Regards Gaetano Mendola