Skip to content

Commit 05fc878

Browse files
committed
config: disable internal GRPC logger by default
The GRPC connection logger is very verbose and normally not very useful. So it leads to more confusion and unnecessary log bloat than it actually helps to debug things. So we disable it by default, meaning that if GRPC=<level> doesn't appear in the log level config string, we add GRPC=off. That means we can still manually turn it on by adding ,GRPC=info to the log config (e.g. --lnd.debuglevel=debug,GRPC=info).
1 parent cb6977f commit 05fc878

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

config.go

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,19 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
386386
// the debug log level(s). In remote lnd mode we have a global log level
387387
// that overwrites all others. In integrated mode we use the lnd log
388388
// level as the master level.
389+
debuglevel := cfg.Lnd.DebugLevel
389390
if cfg.lndRemote {
390-
err = build.ParseAndSetDebugLevels(
391-
cfg.Remote.LitDebugLevel, cfg.Lnd.LogWriter,
392-
)
393-
} else {
394-
err = build.ParseAndSetDebugLevels(
395-
cfg.Lnd.DebugLevel, cfg.Lnd.LogWriter,
396-
)
391+
debuglevel = cfg.Remote.LitDebugLevel
397392
}
393+
394+
// By default, we don't want the GRPC connection-level logger to be
395+
// turned on. So if it isn't specifically mentioned in the debug level
396+
// string, we'll disable it.
397+
if !strings.Contains(debuglevel, GrpcLogSubsystem) {
398+
debuglevel += fmt.Sprintf(",%s=off", GrpcLogSubsystem)
399+
}
400+
401+
err = build.ParseAndSetDebugLevels(debuglevel, cfg.Lnd.LogWriter)
398402
if err != nil {
399403
return nil, err
400404
}

0 commit comments

Comments
 (0)