pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@2ndQuadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Cc: Marc Cousin <cousinmarc@gmail.com>
Subject: Re: BUG #5741: syslog line length
Date: Fri, 5 Aug 2011 19:18:17 -0400
Message-ID: <20110805231816.GD419@tornado.leadboat.com> (raw)
In-Reply-To: <10392.1312584381@sss.pgh.pa.us>
References: <201011021617.oA2GH8L6089397@wwwmaster.postgresql.org>
	<4DF22887.6020701@gmail.com>
	<20110805221811.GC419@tornado.leadboat.com>
	<10392.1312584381@sss.pgh.pa.us>

On Fri, Aug 05, 2011 at 06:46:21PM -0400, Tom Lane wrote:
> Noah Misch <noah@2ndQuadrant.com> writes:
> > A PG_SYSLOG_LIMIT value that loses data to truncation on nearly every default
> > GNU/Linux installation makes for a poor default.
> 
> When I changed it, it was on the strength of tests showing that Fedora
> 8's default syslogger had a limit of 2KB.  A quick check shows this is
> still the case in Fedora 15.  So I'm not convinced that "nearly every"
> is anywhere near true.

Point taken.  Marc hit the 1024 limit in RHEL 5, which appears to be based on
Fedora 6.  Perhaps Fedora began to patch in the higher limit in 7 or 8.  I also
observed the 1024 limit in Ubuntu 8.04 LTS.  It is the limit in the latest
source distributions of sysklogd, too.

> > How about 896?
> 
> But having said that, I could go with 896 (or perhaps 900, which seems
> a shade less weird).

That works for me.

-- 
Noah Misch                    http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachments:

syslog-limit-900.patch (text/plain, 1007B) download *** a/src/backend/utils/error/elog.c --- b/src/backend/utils/error/elog.c *************** *** 105,115 **** int Log_destination = LOG_DESTINATION_STDERR; /* * Max string length to send to syslog(). Note that this doesn't count the * sequence-number prefix we add, and of course it doesn't count the prefix ! * added by syslog itself. On many implementations it seems that the hard ! * limit is approximately 2K bytes including both those prefixes. */ #ifndef PG_SYSLOG_LIMIT ! #define PG_SYSLOG_LIMIT 1024 #endif static bool openlog_done = false; --- 105,115 ---- /* * Max string length to send to syslog(). Note that this doesn't count the * sequence-number prefix we add, and of course it doesn't count the prefix ! * added by syslog itself. Solaris and sysklogd truncate the final message at ! * 1024 bytes, so this value leaves 124 bytes for those prefixes. */ #ifndef PG_SYSLOG_LIMIT ! #define PG_SYSLOG_LIMIT 900 #endif static bool openlog_done = false;

view thread (9+ messages)  latest in thread

Message-ID: <20110805231816.GD419@tornado.leadboat.com>
Permalink:  ../20110805231816.GD419@tornado.leadboat.com/
Also on:    postgresql.org/message-id/20110805231816.GD419@tornado.leadboat.com

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: noah@2ndQuadrant.com, tgl@sss.pgh.pa.us, cousinmarc@gmail.com
  Subject: Re: BUG #5741: syslog line length
  In-Reply-To: <20110805231816.GD419@tornado.leadboat.com>
  References: <201011021617.oA2GH8L6089397@wwwmaster.postgresql.org> <4DF22887.6020701@gmail.com> <20110805221811.GC419@tornado.leadboat.com> <10392.1312584381@sss.pgh.pa.us> <20110805231816.GD419@tornado.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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