server log files

Lists: pgsql-general
From: "EBIHARA, Yuichiro" <ebihara(at)iplocks(dot)co(dot)jp>
To: pgsql-general(at)postgresql(dot)org
Subject: server log files
Date: 2008-06-30 10:48:59
Message-ID: 8869dd0b0806300348h72d7f64u5dcd98a0750f2b28@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Hi Experts,

I'm using PostgreSQL 8.3.3 and have a question about log files that
PostgreSQL generates.

There are two ways to specify the log file path

1)pg_ctl start -l <filename>
http://www.postgresql.org/docs/8.3/interactive/app-pg-ctl.html

2)server configuration (postgresql.conf)
http://www.postgresql.org/docs/8.3/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHERE

I'm now considering the following settings in postgresql.conf.

log_destinatio = stderr
logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%Y-%m-%d.log'
log_rotation_age = 1d
log_truncate_on_rotation = off

I just wonder whether I still should continue using 'pg_ctl start -l
<filename>' to keep useful information about PostgreSQL server status.

I tried enabling both of two log files but few messages were written
to the former one.
It seems only messages generated before those parameters are
recognized and ones generated by pg_ctl itself are written.
For instance, I can see some messages by issueing 'pg_ctl start' while
PostgreSQL is already up.

If all messages while PostgreSQL server is running are wrintten to the
file specified by log_directory and log_filename, I'd like to consider
to start up PostgreSQL as follows:
$pg_ctl start > /dev/null

Any comments or suggestions would be greatly appreciated.
Thanks in advance,

ebi


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "EBIHARA, Yuichiro" <ebihara(at)iplocks(dot)co(dot)jp>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: server log files
Date: 2008-06-30 15:19:55
Message-ID: 28836.1214839195@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

"EBIHARA, Yuichiro" <ebihara(at)iplocks(dot)co(dot)jp> writes:
> I'm now considering the following settings in postgresql.conf.

> log_destinatio = stderr
> logging_collector = on
> log_directory = 'pg_log'
> log_filename = 'postgresql-%Y-%m-%d.log'
> log_rotation_age = 1d
> log_truncate_on_rotation = off

> I just wonder whether I still should continue using 'pg_ctl start -l
> <filename>' to keep useful information about PostgreSQL server status.

You probably still want -l just to capture any error occuring during
server startup. But once the log collector has started to run, nothing
more should get written to that file.

> If all messages while PostgreSQL server is running are wrintten to the
> file specified by log_directory and log_filename, I'd like to consider
> to start up PostgreSQL as follows:
> $pg_ctl start > /dev/null

If the postmaster fails to start, you won't know why.

regards, tom lane


From: "EBIHARA, Yuichiro" <ebihara(at)iplocks(dot)co(dot)jp>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: server log files
Date: 2008-07-01 01:05:33
Message-ID: 8869dd0b0806301805l4d0c9610kc455442bdafd9df2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Tom,

Thanks a lot!

2008/7/1 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> $pg_ctl start > /dev/null
>
> If the postmaster fails to start, you won't know why.

That's enough reason for me to continue using 'pg_ctl start -l'.

ebi