数据仓库服务 GAUSSDB(DWS)-记录日志的内容:logging_module

时间:2023-11-22 14:18:17

logging_module

参数说明:用于设置或者显示模块日志在服务端的可输出性。该参数属于会话级参数,不建议通过gs_guc工具来设置。

参数类型:USERSET

取值范围:字符串

默认值:所有模块日志在服务端是不输出的,可由SHOW logging_module查看。

设置方法:首先,可以通过SHOW logging_module来查看哪些模块是支持可控制的。例如,查询输出结果为:

1
2
3
4
5
show logging_module;
logging_module
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ALL,on(),off(DFS,GUC,HDFS,ORC,SLRU,MEM_CTL,AUTOVAC,ANALYZE,CACHE,ADIO,SSL,GDS,TBLSPC,WLM,SPACE,OBS,EXECUTOR,VEC_EXECUTOR,STREAM,LLVM,OPT,OPT_REWRITE,OPT_JOIN,OPT_AGG,OPT_SUBPLAN,OPT_SETOP,OPT_CARD,OPT_SKEW,SMP,UDF,COOP_ANALYZE,WLMCP,ACCELERATE,PLANHINT,PARQUET,CARBONDATA,SNAPSHOT,XACT,HANDLE,C LOG ,TQUAL,EC,REMOTE,CN_RETRY,PLSQL,TEXTSEARCH,SEQ,INSTR,COMM_IPC,COMM_PA RAM , CS TORE,JOB,STREAMPOOL,STREAM_CTESCAN)
(1 row)

支持可控制的模块使用大写来标识,特殊标识ALL用于对所有模块日志进行设置。可以使用on/off来控制模块日志的输出。设置SSL模块日志为可输出,使用如下命令:

1
2
3
4
5
6
7
8
set logging_module='on(SSL)';
SET
show logging_module;                                                                                                                                                                                                                                                                                                                                                                                              logging_module                       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ALL,on(SSL),off(DFS,GUC,HDFS,ORC,SLRU,MEM_CTL,AUTOVAC,ANALYZE,CACHE,ADIO,GDS,TBLSPC,WLM,SPACE,OBS,EXECUTOR,VEC_EXECUTOR,STREAM,LLVM,OPT,OPT_REWRITE,OPT_JOIN,OPT_AGG,OPT_SUBPLAN,OPT_SETOP,OPT_CARD,OPT_SKEW,SMP,UDF,COOP_ANALYZE,WLMCP,A
CCELERATE,PLANHINT,PARQUET,CARBONDATA,SNAPSHOT,XACT,HANDLE,CLOG,TQUAL,EC,REMOTE,CN_RETRY,PLSQL,TEXTSEARCH,SEQ,INSTR,COMM_IPC,COMM_PARAM,CSTORE,JOB,STREAMPOOL,STREAM_CTESCAN)
(1 row)

可以看到模块SSL的日志输出被打开。

ALL标识是相当于一个快捷操作,即对所有模块的日志可输出进行开启或关闭。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
set logging_module='off(ALL)';
SET
show logging_module;                                                                                                                                                                                                                                                                                                                                                     logging_module                       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ALL,on(),off(DFS,GUC,HDFS,ORC,SLRU,MEM_CTL,AUTOVAC,ANALYZE,CACHE,ADIO,SSL,GDS,TBLSPC,WLM,SPACE,OBS,EXECUTOR,VEC_EXECUTOR,STREAM,LLVM,OPT,OPT_REWRITE,OPT_JOIN,OPT_AGG,OPT_SUBPLAN,OPT_SETOP,OPT_CARD,OPT_SKEW,SMP,UDF,COOP_ANALYZE,WLMCP,
ACCELERATE,PLANHINT,PARQUET,CARBONDATA,SNAPSHOT,XACT,HANDLE,CLOG,TQUAL,EC,REMOTE,CN_RETRY,PLSQL,TEXTSEARCH,SEQ,INSTR,COMM_IPC,COMM_PARAM,CSTORE,JOB,STREAMPOOL,STREAM_CTESCAN)
(1 row)

set logging_module='on(ALL)';
SET
show logging_module;                                                                                                                                                                                                                                                                                                                                  logging_module                       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 ALL,on(DFS,GUC,HDFS,ORC,SLRU,MEM_CTL,AUTOVAC,ANALYZE,CACHE,ADIO,SSL,GDS,TBLSPC,WLM,SPACE,OBS,EXECUTOR,VEC_EXECUTOR,STREAM,LLVM,OPT,OPT_REWRITE,OPT_JOIN,OPT_AGG,OPT_SUBPLAN,OPT_SETOP,OPT_CARD,OPT_SKEW,SMP,UDF,COOP_ANALYZE,WLMCP,ACCELE
RATE,PLANHINT,PARQUET,CARBONDATA,SNAPSHOT,XACT,HANDLE,CLOG,TQUAL,EC,REMOTE,CN_RETRY,PLSQL,TEXTSEARCH,SEQ,INSTR,COMM_IPC,COMM_PARAM,CSTORE,JOB,STREAMPOOL,STREAM_CTESCAN),off()
(1 row)

所有模块中,COMM_IPC必须显式的打开/开闭,执行以下命令都可以将该模块的日志打开:

1
2
3
4
set logging_module='on(ALL)';
SET
set logging_module='on(COMM_IPC)';
SET

设置成功后,COMM_IPC模块日志不会自动关闭,关闭COMM_IPC模块的日志,必须手动执行关闭命令,以下两条命令都可以将该模块日志关闭:

1
2
3
4
set logging_module='off(ALL)';
SET
set logging_module='off(COMM_IPC)';
SET

依赖关系:该参数依赖于log_min_messages参数的设置。

support.huaweicloud.com/devg-820-dws/dws_04_0916.html