cmd/commands: add --include_log flag to getdebuginfo CLI
What changed, and why it matters
This commit adds a new optional --include_log flag to two LND command-line tools (getdebuginfo and encryptdebugpackage). When the user explicitly sets this flag, log file content is included in the debug output or encrypted support package. By default, logs are not included. There is no security vulnerability here; it is a user-controlled privacy/feature change.
No security action required. Treat as a normal feature commit. Operators should be aware that using --include_log may place sensitive log data into support packages.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch wires a new boolean CLI flag, include_log, into the existing lnrpc.GetDebugInfoRequest.IncludeLog field for both getDebugInfo and collectDebugPackageInfo. It also updates help text to note that getdebuginfo now returns config only by default and that –include_log adds log content. No server-side logic changes are visible in this diff; the behavior is opt-in and client-facing only.
Changed components
cmd/commands/cmd_debug.golncli getdebuginfo commandlncli encryptdebugpackage commandInspect captured patch +24 / −3
diff --git a/cmd/commands/cmd_debug.go b/cmd/commands/cmd_debug.go
index 37024f5..eca1a30 100644
--- a/cmd/commands/cmd_debug.go
+++ b/cmd/commands/cmd_debug.go
@@ -23,14 +23,26 @@ var getDebugInfoCommand = cli.Command{
Category: "Debug",
Usage: "Returns debug information related to the active daemon.",
Action: actionDecorator(getDebugInfo),
+ Flags: []cli.Flag{
+ cli.BoolFlag{
+ Name: "include_log",
+ Usage: "if set, the log file content is " +
+ "included in the response in " +
+ "addition to the config",
+ },
+ },
}
+// getDebugInfo retrieves debug information from the daemon, optionally
+// including the log file content.
func getDebugInfo(ctx *cli.Context) error {
ctxc := getContext()
client, cleanUp := getClient(ctx)
defer cleanUp()
- req := &lnrpc.GetDebugInfoRequest{}
+ req := &lnrpc.GetDebugInfoRequest{
+ IncludeLog: ctx.Bool("include_log"),
+ }
resp, err := client.GetDebugInfo(ctxc, req)
if err != nil {
return err
@@ -61,12 +73,14 @@ var encryptDebugPackageCommand = cli.Command{
The file by default contains the output of the following commands:
- lncli getinfo
- - lncli getdebuginfo
+ - lncli getdebuginfo (config only)
- lncli getnetworkinfo
By specifying the following flags, additional information can be added
to the file (usually this will be requested by the developer depending
on the issue at hand):
+ --include_log:
+ - includes the log file content in the debug info
--peers:
- lncli listpeers
--onchain:
@@ -113,6 +127,11 @@ var encryptDebugPackageCommand = cli.Command{
"(lncli listchannels, lncli pendingchannels, " +
"lncli closedchannels)",
},
+ cli.BoolFlag{
+ Name: "include_log",
+ Usage: "include the log file content in the " +
+ "debug package",
+ },
},
Action: actionDecorator(encryptDebugPackage),
}
@@ -226,7 +245,9 @@ func collectDebugPackageInfo(ctx *cli.Context) ([]byte, error) {
}
debugInfo, err := client.GetDebugInfo(
- ctxc, &lnrpc.GetDebugInfoRequest{},
+ ctxc, &lnrpc.GetDebugInfoRequest{
+ IncludeLog: ctx.Bool("include_log"),
+ },
)
if err != nil {
return nil, fmt.Errorf("error getting debug info: %w", err)
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.