pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feed8.3 Logging Question
6+ messages / 3 participants
[nested] [flat]
* 8.3 Logging Question
@ 2008-01-24 18:31 Chris Hoover <revoohc@gmail.com>
2008-01-24 19:56 ` Re: 8.3 Logging Question Guillaume Lelarge <guillaume@lelarge.info>
2008-01-24 22:38 ` Re: 8.3 Logging Question Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 6+ messages in thread
From: Chris Hoover @ 2008-01-24 18:31 UTC (permalink / raw)
To: pgsql-admin
I'm running PG 8.3rc2 to start testing it out, and really like how it is
preforming for me so far. However, I have one question on the logging. I
am trying to use syslog and csvlog to log all sql. This seems to work great
except that for every log rotation postgres does, I get a .csv log file that
grows and a 0 byte .log file. Since I'm not logging to stderr, why is the
.log file being created, and how do I turn that off?
Thanks for your help,
Chris
Relevent config file portion:
#------------------------------------------------------------------------------
# ERROR REPORTING AND LOGGING
#------------------------------------------------------------------------------
# - Where to Log -
log_destination = 'syslog,csvlog' # Valid values are
combinations of
# stderr, csvlog, syslog and
eventlog,
# depending on platform. csvlog
# requires logging_collector to be
on.
# This is used when logging to stderr:
logging_collector = on # Enable capturing of stderr and
csvlog
# into log files. Required to be on
for
# csvlogs.
# (change requires restart)
# These are only used if logging_collector is on:
log_directory = 'pg_log' # directory where log files are
written,
# can be absolute or relative to
PGDATA
#log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name
pattern,
# can include strftime() escapes
log_truncate_on_rotation = on # If on, an existing log file of the
# same name as the new log file will
be
# truncated rather than appended to.
# But such truncation only occurs on
# time-driven rotation, not on
restarts
# or size-driven rotation. Default
is
# off, meaning append to existing
files
# in all cases.
log_rotation_age = 1h # Automatic rotation of logfiles
will
# happen after that time. 0 to
disable.
log_rotation_size = 0 # Automatic rotation of logfiles
will
# happen after that much log output.
# 0 to disable.
# These are relevant when logging to syslog:
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 8.3 Logging Question
2008-01-24 18:31 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
@ 2008-01-24 19:56 ` Guillaume Lelarge <guillaume@lelarge.info>
2008-01-24 20:26 ` Re: 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Guillaume Lelarge @ 2008-01-24 19:56 UTC (permalink / raw)
To: Chris Hoover <revoohc@gmail.com>; +Cc: pgsql-admin
Chris Hoover wrote:
> I'm running PG 8.3rc2 to start testing it out, and really like how it is
> preforming for me so far. However, I have one question on the logging.
> I am trying to use syslog and csvlog to log all sql. This seems to work
> great except that for every log rotation postgres does, I get a .csv log
> file that grows and a 0 byte .log file. Since I'm not logging to
> stderr, why is the .log file being created, and how do I turn that off?
>
Yes, I have the same issue. I don't think you can do something to stop
this behaviour. postmaster process creates the directory if not present,
then tries to create a file in it, and finally launches the syslogger
subprocess. The file it creates is your .log file. I'm not sure why it
creates a .log file. Perhaps the postmaster process has no idea at this
time that the DBA wants csvlog files.
Anyways, you'll only have one .log file because rotation function takes
care of the log_destination.
> [...]
> log_destination = 'syslog,csvlog' # Valid values are
> combinations of
This is kind of strange. It should be syslog or csvlog. It shouldn't be
both of them. Or am I wrong ?
Regards.
--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 8.3 Logging Question
2008-01-24 18:31 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
2008-01-24 19:56 ` Re: 8.3 Logging Question Guillaume Lelarge <guillaume@lelarge.info>
@ 2008-01-24 20:26 ` Chris Hoover <revoohc@gmail.com>
0 siblings, 0 replies; 6+ messages in thread
From: Chris Hoover @ 2008-01-24 20:26 UTC (permalink / raw)
To: Guillaume Lelarge <guillaume@lelarge.info>; +Cc: pgsql-admin
>
> > [...]
> > log_destination = 'syslog,csvlog' # Valid values are
> > combinations of
>
> This is kind of strange. It should be syslog or csvlog. It shouldn't be
> both of them. Or am I wrong ?
>
> Regards.
>
>
> --
> Guillaume.
> http://www.postgresqlfr.org
> http://dalibo.com
>
The documentation stated you could log to multiple destinations by comma
separating them.
Since this is my personal test area, I'm looking at both types of logging.
I am very interested in being able to load the logs into a table so that I
can do further mining on them, so I am testing the csvlog. I have also been
wanting to try the syslog feature for the logs, so I am testing this also.
Really nice to have the option to send the logs to multiple outlets.
HTH.
Chris
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 8.3 Logging Question
2008-01-24 18:31 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
@ 2008-01-24 22:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2008-01-25 00:11 ` Re: 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
1 sibling, 1 reply; 6+ messages in thread
From: Tom Lane @ 2008-01-24 22:38 UTC (permalink / raw)
To: Chris Hoover <revoohc@gmail.com>; +Cc: pgsql-admin
"Chris Hoover" <revoohc@gmail.com> writes:
> I'm running PG 8.3rc2 to start testing it out, and really like how it is
> preforming for me so far. However, I have one question on the logging. I
> am trying to use syslog and csvlog to log all sql. This seems to work great
> except that for every log rotation postgres does, I get a .csv log file that
> grows and a 0 byte .log file. Since I'm not logging to stderr, why is the
> .log file being created, and how do I turn that off?
The .log file is to catch any non-csv-format data that comes down the
pipe. You can't turn it off.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 8.3 Logging Question
2008-01-24 18:31 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
2008-01-24 22:38 ` Re: 8.3 Logging Question Tom Lane <tgl@sss.pgh.pa.us>
@ 2008-01-25 00:11 ` Chris Hoover <revoohc@gmail.com>
2008-01-25 00:36 ` Re: 8.3 Logging Question Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Chris Hoover @ 2008-01-25 00:11 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-admin
On Jan 24, 2008 5:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> The .log file is to catch any non-csv-format data that comes down the
> pipe. You can't turn it off.
>
> regards, tom lane
What type of data would you expect this to be?
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: 8.3 Logging Question
2008-01-24 18:31 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
2008-01-24 22:38 ` Re: 8.3 Logging Question Tom Lane <tgl@sss.pgh.pa.us>
2008-01-25 00:11 ` Re: 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
@ 2008-01-25 00:36 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 6+ messages in thread
From: Tom Lane @ 2008-01-25 00:36 UTC (permalink / raw)
To: Chris Hoover <revoohc@gmail.com>; +Cc: pgsql-admin
"Chris Hoover" <revoohc@gmail.com> writes:
> On Jan 24, 2008 5:38 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> The .log file is to catch any non-csv-format data that comes down the
>> pipe. You can't turn it off.
> What type of data would you expect this to be?
Any bit of code that doesn't know about elog, for instance
--- shared library linking problems from the dynamic loader
--- complaints from perl, python, or other libraries you might have
loaded into the backend
--- corrupted-memory messages out of glibc (malloc)
--- yadda yadda yadda
One of the main strikes against syslog logging has always been that
it fails to capture this type of stuff. You don't realize you need
this until you need it, but then you really do.
regards, tom lane
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2008-01-25 00:36 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-01-24 18:31 8.3 Logging Question Chris Hoover <revoohc@gmail.com>
2008-01-24 19:56 ` Guillaume Lelarge <guillaume@lelarge.info>
2008-01-24 20:26 ` Chris Hoover <revoohc@gmail.com>
2008-01-24 22:38 ` Tom Lane <tgl@sss.pgh.pa.us>
2008-01-25 00:11 ` Chris Hoover <revoohc@gmail.com>
2008-01-25 00:36 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox