Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
fc201dfd
Commit
fc201dfd
authored
Mar 15, 2016
by
Peter Eisentraut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add syslog_split_messages parameter
Reviewed-by:
Andreas Karlsson
<
andreas@proxel.se
>
parent
f4c454e9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
1 deletion
+47
-1
doc/src/sgml/config.sgml
doc/src/sgml/config.sgml
+33
-0
src/backend/utils/error/elog.c
src/backend/utils/error/elog.c
+2
-1
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+10
-0
src/backend/utils/misc/postgresql.conf.sample
src/backend/utils/misc/postgresql.conf.sample
+1
-0
src/include/utils/elog.h
src/include/utils/elog.h
+1
-0
No files found.
doc/src/sgml/config.sgml
View file @
fc201dfd
...
@@ -4333,6 +4333,39 @@ local0.* /var/log/postgresql
...
@@ -4333,6 +4333,39 @@ local0.* /var/log/postgresql
</listitem>
</listitem>
</varlistentry>
</varlistentry>
<varlistentry id="guc-syslog-split-messages" xreflabel="syslog_split_messages">
<term><varname>syslog_split_messages</varname> (<type>boolean</type>)
<indexterm>
<primary><varname>syslog_split_messages</> configuration parameter</primary>
</indexterm>
</term>
<listitem>
<para>
When logging to <application>syslog</> is enabled, this parameter
determines how messages are delivered to syslog. When on (the
default), messages are split by lines, and long lines are split so
that they will fit into 1024 bytes, which is a typical size limit for
traditional syslog implementations. When off, PostgreSQL server log
messages are delivered to the syslog service as is, and it is up to
the syslog service to cope with the potentially bulky messages.
</para>
<para>
If syslog is ultimately logging to a text file, then the effect will
be the same either way, and it is best to leave the setting on, since
most syslog implementations either cannot handle large messages or
would need to be specially configured to handle them. But if syslog
is ultimately writing into some other medium, it might be necessary or
more useful to keep messages logically together.
</para>
<para>
This parameter can only be set in the <filename>postgresql.conf</>
file or on the server command line.
</para>
</listitem>
</varlistentry>
<varlistentry id="guc-event-source" xreflabel="event_source">
<varlistentry id="guc-event-source" xreflabel="event_source">
<term><varname>event_source</varname> (<type>string</type>)
<term><varname>event_source</varname> (<type>string</type>)
<indexterm>
<indexterm>
...
...
src/backend/utils/error/elog.c
View file @
fc201dfd
...
@@ -107,6 +107,7 @@ char *Log_line_prefix = NULL; /* format for extra log line info */
...
@@ -107,6 +107,7 @@ char *Log_line_prefix = NULL; /* format for extra log line info */
int
Log_destination
=
LOG_DESTINATION_STDERR
;
int
Log_destination
=
LOG_DESTINATION_STDERR
;
char
*
Log_destination_string
=
NULL
;
char
*
Log_destination_string
=
NULL
;
bool
syslog_sequence_numbers
=
true
;
bool
syslog_sequence_numbers
=
true
;
bool
syslog_split_messages
=
true
;
#ifdef HAVE_SYSLOG
#ifdef HAVE_SYSLOG
...
@@ -1966,7 +1967,7 @@ write_syslog(int level, const char *line)
...
@@ -1966,7 +1967,7 @@ write_syslog(int level, const char *line)
*/
*/
len
=
strlen
(
line
);
len
=
strlen
(
line
);
nlpos
=
strchr
(
line
,
'\n'
);
nlpos
=
strchr
(
line
,
'\n'
);
if
(
len
>
PG_SYSLOG_LIMIT
||
nlpos
!=
NULL
)
if
(
syslog_split_messages
&&
(
len
>
PG_SYSLOG_LIMIT
||
nlpos
!=
NULL
)
)
{
{
int
chunk_nr
=
0
;
int
chunk_nr
=
0
;
...
...
src/backend/utils/misc/guc.c
View file @
fc201dfd
...
@@ -1642,6 +1642,16 @@ static struct config_bool ConfigureNamesBool[] =
...
@@ -1642,6 +1642,16 @@ static struct config_bool ConfigureNamesBool[] =
NULL
,
NULL
,
NULL
NULL
,
NULL
,
NULL
},
},
{
{
"syslog_split_messages"
,
PGC_SIGHUP
,
LOGGING_WHERE
,
gettext_noop
(
"Split messages sent to syslog by lines and to fit into 1024 bytes."
),
NULL
},
&
syslog_split_messages
,
true
,
NULL
,
NULL
,
NULL
},
/* End-of-list marker */
/* End-of-list marker */
{
{
{
NULL
,
0
,
0
,
NULL
,
NULL
},
NULL
,
false
,
NULL
,
NULL
,
NULL
{
NULL
,
0
,
0
,
NULL
,
NULL
},
NULL
,
false
,
NULL
,
NULL
,
NULL
...
...
src/backend/utils/misc/postgresql.conf.sample
View file @
fc201dfd
...
@@ -359,6 +359,7 @@
...
@@ -359,6 +359,7 @@
#syslog_facility = 'LOCAL0'
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#syslog_ident = 'postgres'
#syslog_sequence_numbers = on
#syslog_sequence_numbers = on
#syslog_split_messages = on
# This is only relevant when logging to eventlog (win32):
# This is only relevant when logging to eventlog (win32):
#event_source = 'PostgreSQL'
#event_source = 'PostgreSQL'
...
...
src/include/utils/elog.h
View file @
fc201dfd
...
@@ -398,6 +398,7 @@ extern char *Log_line_prefix;
...
@@ -398,6 +398,7 @@ extern char *Log_line_prefix;
extern
int
Log_destination
;
extern
int
Log_destination
;
extern
char
*
Log_destination_string
;
extern
char
*
Log_destination_string
;
extern
bool
syslog_sequence_numbers
;
extern
bool
syslog_sequence_numbers
;
extern
bool
syslog_split_messages
;
/* Log destination bitmap */
/* Log destination bitmap */
#define LOG_DESTINATION_STDERR 1
#define LOG_DESTINATION_STDERR 1
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment