Re: Logging on Gentoo

From: "Thom Brown" <thombrown(at)gmail(dot)com>
To: "Richard Huxton" <dev(at)archonet(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Logging on Gentoo
Date: 2009-01-14 12:40:56
Message-ID: bddc86150901140440j77397328k803cb0e9257bd645@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tsk... that was it after all. I didn't have logging_collector set to on,
and thanks to that helpful query you mentioned, I could see that the default
was "off". The reason I didn't change it was because I was trying to copy
the settings from a server I use at work which does output logging, but
there's no logging_collector setting on that version.

I now have a logging file.

Thanks for your help :)

Thom

2009/1/14 Richard Huxton <dev(at)archonet(dot)com>

> Thom Brown wrote:
> > Hi,
> >
> > I've configured Postgres to log to stderr and defined my log directory
> > correctly with permissions to postgres on both user and group. I've
> > restarted postgres (not reloaded) but nothinig is coming out. Upon
> reading
> > the documentation for using stderr, it mentions the need to change the
> > system's syslog daemon.
> >
> > It says it should look something like "local0.* /var/log/postgresql"
>
> Only if you're logging to syslog.
>
> >
> > I can't find this syslog configuration. I have a file in /etc/syslog-ng
> > called syslog-ng.conf which contains the following:
> [snip]
> > I can't see how I would change this as per the documentation's
> > recommendations. Am I looking at the right configuration file?
>
> You'd probably need to check the syslog-ng manuals. All the syslog
> (original) line does is send everything that comes from local0 (which is
> what PG logs as) to /var/log/postgresql.
>
> > I'm using PostgreSQL 8.3.5 on an up-to-date Gentoo. I had a look at this
> > problem about 6 months ago and had the same problem, but now I want to
> get
> > it working.
>
> What you want in your postgresql.conf is something like:
>
> log_destination = stderr
> logging_collector = on
> log_directory = '/var/log/pgsql83'
> log_filename = 'postgresql-%Y-%m-%d.log'
> log_rotation_age = 1d
>
> If permissions on /var/log/pgsql83 are correct that should generate a
> new log-file every day with the year-month-day in the filename.
>
> You can check settings from within psql with: "show log_destination;"
> etc. or see them in one go:
>
> SELECT name,setting,unit,category,source FROM pg_settings WHERE name
> LIKE 'log%';
>
> HTH
>
> --
> Richard Huxton
> Archonet Ltd
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message pere roca 2009-01-14 12:43:35 simple limit of decimals
Previous Message ries van Twisk 2009-01-14 12:33:43 Strange invalid constrain problem with PostgreSQL 8.3.1