From 97d3f1b50650bddd9db5f69b6774cd8e57f5bace Mon Sep 17 00:00:00 2001 From: akshya96 Date: Fri, 12 Aug 2022 14:18:51 -0700 Subject: [PATCH 1/4] debug empty lines in vault.log --- command/debug.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/command/debug.go b/command/debug.go index 631ec9b418c6..f0c6a576749b 100644 --- a/command/debug.go +++ b/command/debug.go @@ -1080,13 +1080,15 @@ func (c *DebugCommand) writeLogs(ctx context.Context) { for { select { case log := <-logCh: - if !strings.HasSuffix(log, "\n") { - log += "\n" - } - _, err = out.WriteString(log) - if err != nil { - c.captureError("log", err) - return + if len(log) >0 { + if !strings.HasSuffix(log, "\n") { + log += "\n" + } + _, err = out.WriteString(log) + if err != nil { + c.captureError("log", err) + return + } } case <-ctx.Done(): return From 76b98a361bb18569097bf32bfd4ca47b77505a9a Mon Sep 17 00:00:00 2001 From: akshya96 Date: Fri, 12 Aug 2022 14:29:46 -0700 Subject: [PATCH 2/4] minor grammar fix --- website/content/api-docs/system/monitor.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/content/api-docs/system/monitor.mdx b/website/content/api-docs/system/monitor.mdx index e29f2cb46781..377c22cac4bc 100644 --- a/website/content/api-docs/system/monitor.mdx +++ b/website/content/api-docs/system/monitor.mdx @@ -26,7 +26,7 @@ default, this is text. - `log_level` `(string: "info")` – Specifies the log level to use when streaming logs. This defaults to `info` if not specified. -- `log_format` `(string: "standard")` – Specifies the log format to emit when streaming logs. Supported values are "standard" and "json". The default is `standard`. +- `log_format` `(string: "standard")` – Specifies the log format to emit when streaming logs. Supported values are "standard" and "json". The default is `standard`, if not specified. ### Sample Request From a3624c0354aab4c1162c7ab8609bd3d4e7bfa762 Mon Sep 17 00:00:00 2001 From: akshya96 Date: Fri, 12 Aug 2022 14:46:32 -0700 Subject: [PATCH 3/4] add changelog --- changelog/16714.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog/16714.txt diff --git a/changelog/16714.txt b/changelog/16714.txt new file mode 100644 index 000000000000..a13610699aae --- /dev/null +++ b/changelog/16714.txt @@ -0,0 +1,3 @@ +```release-note:bug +debug: Remove extra empty lines from vault.log when debug command is run +``` \ No newline at end of file From 486e41792dc462017138c03b4364e5376184c9ca Mon Sep 17 00:00:00 2001 From: akshya96 Date: Fri, 12 Aug 2022 15:06:51 -0700 Subject: [PATCH 4/4] add fmt changes --- command/debug.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/command/debug.go b/command/debug.go index f0c6a576749b..8213507cdf9f 100644 --- a/command/debug.go +++ b/command/debug.go @@ -1080,7 +1080,7 @@ func (c *DebugCommand) writeLogs(ctx context.Context) { for { select { case log := <-logCh: - if len(log) >0 { + if len(log) > 0 { if !strings.HasSuffix(log, "\n") { log += "\n" }