aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-05 21:02:31 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-05 21:02:31 -0400
commit375aa7b393843800a2bfefcbc13fa68ca82dee53 (patch)
tree8366914f8d17d999d279138d3182c2993966e36b
parentc4096c76399ad99dce35cd62f60599ea8748a3dd (diff)
downloadpostgresql-375aa7b393843800a2bfefcbc13fa68ca82dee53.tar.gz
postgresql-375aa7b393843800a2bfefcbc13fa68ca82dee53.zip
Reduce PG_SYSLOG_LIMIT to 900 bytes.
The previous limit of 1024 was set on the assumption that all modern syslog implementations have line length limits of 2KB or so. However, this is false, as at least Solaris and sysklogd truncate at only 1KB. 900 seems to leave enough room for the max likely length of the tacked-on prefixes, so let's go with that. As with the previous change, it doesn't seem wise to back-patch this into already-released branches; but it should be OK to sneak it into 9.1. Noah Misch
-rw-r--r--src/backend/utils/error/elog.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 7c7927509b5..6e8e5aef4e0 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -105,11 +105,12 @@ 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.
+ * added by syslog itself. Solaris and sysklogd truncate the final message
+ * at 1024 bytes, so this value leaves 124 bytes for those prefixes. (Most
+ * other syslog implementations seem to have limits of 2KB or so.)
*/
#ifndef PG_SYSLOG_LIMIT
-#define PG_SYSLOG_LIMIT 1024
+#define PG_SYSLOG_LIMIT 900
#endif
static bool openlog_done = false;