1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

debug: Add new smb.conf option "debug syslog format"

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Mon Nov  1 07:29:47 UTC 2021 on sn-devel-184
This commit is contained in:
Martin Schwenke 2021-10-31 11:59:30 +11:00 committed by Ralph Boehme
parent 5e1e9d74ab
commit 494eb0c22a
5 changed files with 28 additions and 1 deletions

View File

@ -9,7 +9,8 @@
</para> </para>
<para> <para>
Note that the parameter <smbconfoption name="debug timestamp"/> must be on for this to have an effect. Note that the parameter <smbconfoption name="debug timestamp"/> or
<smbconfoption name="debug syslog format"/> must be on for this to have an effect.
</para> </para>
</description> </description>

View File

@ -0,0 +1,21 @@
<samba:parameter name="debug syslog format"
context="G"
type="boolean"
xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
<description>
<para>
With this option enabled, debug messages are printed in a
single-line format like that traditionally produced by syslog.
The timestamp consists of an abbreviated month, space-padded date,
and time including seconds. This is followed by the hostname and
the program name, with the process-ID in square brackets.
</para>
<para>
If <smbconfoption name="debug hires timestamp"/> is also enabled
then an RFC5424 timestamp is used instead.
</para>
</description>
<value type="default">no</value>
</samba:parameter>

View File

@ -2559,6 +2559,7 @@ struct loadparm_context *loadparm_init(TALLOC_CTX *mem_ctx)
lpcfg_do_global_parameter(lp_ctx, "debug timestamp", "Yes"); lpcfg_do_global_parameter(lp_ctx, "debug timestamp", "Yes");
lpcfg_do_global_parameter(lp_ctx, "debug prefix timestamp", "No"); lpcfg_do_global_parameter(lp_ctx, "debug prefix timestamp", "No");
lpcfg_do_global_parameter(lp_ctx, "debug hires timestamp", "Yes"); lpcfg_do_global_parameter(lp_ctx, "debug hires timestamp", "Yes");
lpcfg_do_global_parameter(lp_ctx, "debug syslog format", "No");
lpcfg_do_global_parameter(lp_ctx, "debug pid", "No"); lpcfg_do_global_parameter(lp_ctx, "debug pid", "No");
lpcfg_do_global_parameter(lp_ctx, "debug uid", "No"); lpcfg_do_global_parameter(lp_ctx, "debug uid", "No");
lpcfg_do_global_parameter(lp_ctx, "debug class", "No"); lpcfg_do_global_parameter(lp_ctx, "debug class", "No");
@ -3102,6 +3103,7 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx)
settings.timestamp_logs = lp_ctx->globals->timestamp_logs; settings.timestamp_logs = lp_ctx->globals->timestamp_logs;
settings.debug_prefix_timestamp = lp_ctx->globals->debug_prefix_timestamp; settings.debug_prefix_timestamp = lp_ctx->globals->debug_prefix_timestamp;
settings.debug_hires_timestamp = lp_ctx->globals->debug_hires_timestamp; settings.debug_hires_timestamp = lp_ctx->globals->debug_hires_timestamp;
settings.debug_syslog_format = lp_ctx->globals->debug_syslog_format;
settings.debug_pid = lp_ctx->globals->debug_pid; settings.debug_pid = lp_ctx->globals->debug_pid;
settings.debug_uid = lp_ctx->globals->debug_uid; settings.debug_uid = lp_ctx->globals->debug_uid;
settings.debug_class = lp_ctx->globals->debug_class; settings.debug_class = lp_ctx->globals->debug_class;

View File

@ -36,6 +36,7 @@ bool reopen_logs(void)
.timestamp_logs = lp_timestamp_logs(), .timestamp_logs = lp_timestamp_logs(),
.debug_prefix_timestamp = lp_debug_prefix_timestamp(), .debug_prefix_timestamp = lp_debug_prefix_timestamp(),
.debug_hires_timestamp = lp_debug_hires_timestamp(), .debug_hires_timestamp = lp_debug_hires_timestamp(),
.debug_syslog_format = lp_debug_syslog_format(),
.debug_pid = lp_debug_pid(), .debug_pid = lp_debug_pid(),
.debug_uid = lp_debug_uid(), .debug_uid = lp_debug_uid(),
.debug_class = lp_debug_class(), .debug_class = lp_debug_class(),
@ -60,6 +61,7 @@ bool reopen_logs(void)
.timestamp_logs = true, .timestamp_logs = true,
.debug_prefix_timestamp = false, .debug_prefix_timestamp = false,
.debug_hires_timestamp = true, .debug_hires_timestamp = true,
.debug_syslog_format = false,
.debug_pid = false, .debug_pid = false,
.debug_uid = false, .debug_uid = false,
.debug_class = false, .debug_class = false,

View File

@ -675,6 +675,7 @@ static void init_globals(struct loadparm_context *lp_ctx, bool reinit_globals)
lpcfg_string_set(Globals.ctx, &Globals.log_level, "0"); lpcfg_string_set(Globals.ctx, &Globals.log_level, "0");
Globals.debug_prefix_timestamp = false; Globals.debug_prefix_timestamp = false;
Globals.debug_hires_timestamp = true; Globals.debug_hires_timestamp = true;
Globals.debug_syslog_format = false;
Globals.debug_pid = false; Globals.debug_pid = false;
Globals.debug_uid = false; Globals.debug_uid = false;
Globals.debug_class = false; Globals.debug_class = false;