On Fri, Aug 05, 2011 at 06:46:21PM -0400, Tom Lane wrote:
> Noah Misch <n...@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
*** 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;
-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

Reply via email to