Skip to content

Commit 6b7eebc

Browse files
committed
Increase PG_SYSLOG_LIMIT (the max line length sent to syslog()) from 128 to
1024 to improve performance when sending large elog messages. Also add a comment about why we use that number. Since this represents an externally visible behavior change, and might possibly result in portability issues, it seems best not to back-patch it.
1 parent 3793310 commit 6b7eebc

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/backend/utils/error/elog.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
*
4444
* IDENTIFICATION
45-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.204 2008/07/08 22:17:41 tgl Exp $
45+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.205 2008/07/09 15:56:49 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -85,6 +85,17 @@ char *Log_line_prefix = NULL; /* format for extra log line info */
8585
int Log_destination = LOG_DESTINATION_STDERR;
8686

8787
#ifdef HAVE_SYSLOG
88+
89+
/*
90+
* Max string length to send to syslog(). Note that this doesn't count the
91+
* sequence-number prefix we add, and of course it doesn't count the prefix
92+
* added by syslog itself. On many implementations it seems that the hard
93+
* limit is approximately 2K bytes including both those prefixes.
94+
*/
95+
#ifndef PG_SYSLOG_LIMIT
96+
#define PG_SYSLOG_LIMIT 1024
97+
#endif
98+
8899
static bool openlog_done = false;
89100
static char *syslog_ident = NULL;
90101
static int syslog_facility = LOG_LOCAL0;
@@ -1257,7 +1268,6 @@ DebugFileOpen(void)
12571268
}
12581269

12591270

1260-
12611271
#ifdef HAVE_SYSLOG
12621272

12631273
/*
@@ -1293,10 +1303,6 @@ set_syslog_parameters(const char *ident, int facility)
12931303
}
12941304

12951305

1296-
#ifndef PG_SYSLOG_LIMIT
1297-
#define PG_SYSLOG_LIMIT 128
1298-
#endif
1299-
13001306
/*
13011307
* Write a message line to syslog
13021308
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy