[lug] How to Move Log Output to /var/log?

Hugh Brown hugh at math.byu.edu
Sun Aug 12 13:29:12 MDT 2007


Bill Thoen wrote:
> I've just set up a copy of PostgreSQL on a Fedora Core 6 machine, and
> currently its log output is pointing to the default file
> /usr/local/pgsql/data/serverlog.
> 
> I'd like to send that to var/log/pgsql/serverlog, but since the process
> is run by the user postgres, how do I get it write into the /var/log
> directory, which is owned by root? I notice that apache seems to be able to
> write into /var/log/httpd as root, but how do you do that?
> 
> TIA,
> 
> - Bill Thoen

I'd create /var/log/pgsql  chown postgres /var/log/pgsql and then alter 
postgresql.conf as necessary to point at a file or to syslog.

You can go to 
http://www.postgresql.org/docs/8.2/interactive/runtime-config-logging.html 
for information about how to configure logging (this is for postgres 
8.2, it may be different for earlier versions)


Hugh



More information about the LUG mailing list