Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Greenplum
Gpdb
提交
fc201dfd
G
Gpdb
项目概览
Greenplum
/
Gpdb
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Gpdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
fc201dfd
编写于
3月 15, 2016
作者:
P
Peter Eisentraut
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add syslog_split_messages parameter
Reviewed-by:
N
Andreas Karlsson
<
andreas@proxel.se
>
上级
f4c454e9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
47 addition
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
未找到文件。
doc/src/sgml/config.sgml
浏览文件 @
fc201dfd
...
...
@@ -4333,6 +4333,39 @@ local0.* /var/log/postgresql
</listitem>
</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">
<term><varname>event_source</varname> (<type>string</type>)
<indexterm>
...
...
src/backend/utils/error/elog.c
浏览文件 @
fc201dfd
...
...
@@ -107,6 +107,7 @@ char *Log_line_prefix = NULL; /* format for extra log line info */
int
Log_destination
=
LOG_DESTINATION_STDERR
;
char
*
Log_destination_string
=
NULL
;
bool
syslog_sequence_numbers
=
true
;
bool
syslog_split_messages
=
true
;
#ifdef HAVE_SYSLOG
...
...
@@ -1966,7 +1967,7 @@ write_syslog(int level, const char *line)
*/
len
=
strlen
(
line
);
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
;
...
...
src/backend/utils/misc/guc.c
浏览文件 @
fc201dfd
...
...
@@ -1642,6 +1642,16 @@ static struct config_bool ConfigureNamesBool[] =
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 */
{
{
NULL
,
0
,
0
,
NULL
,
NULL
},
NULL
,
false
,
NULL
,
NULL
,
NULL
...
...
src/backend/utils/misc/postgresql.conf.sample
浏览文件 @
fc201dfd
...
...
@@ -359,6 +359,7 @@
#syslog_facility = 'LOCAL0'
#syslog_ident = 'postgres'
#syslog_sequence_numbers = on
#syslog_split_messages = on
# This is only relevant when logging to eventlog (win32):
#event_source = 'PostgreSQL'
...
...
src/include/utils/elog.h
浏览文件 @
fc201dfd
...
...
@@ -398,6 +398,7 @@ extern char *Log_line_prefix;
extern
int
Log_destination
;
extern
char
*
Log_destination_string
;
extern
bool
syslog_sequence_numbers
;
extern
bool
syslog_split_messages
;
/* Log destination bitmap */
#define LOG_DESTINATION_STDERR 1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录