Skip to content

Commit

Permalink
config: disable internal GRPC logger by default
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
guggero committed Nov 7, 2024
1 parent cb6977f commit 05fc878
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,15 +386,19 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
// the debug log level(s). In remote lnd mode we have a global log level
// that overwrites all others. In integrated mode we use the lnd log
// level as the master level.
debuglevel := cfg.Lnd.DebugLevel
if cfg.lndRemote {
err = build.ParseAndSetDebugLevels(
cfg.Remote.LitDebugLevel, cfg.Lnd.LogWriter,
)
} else {
err = build.ParseAndSetDebugLevels(
cfg.Lnd.DebugLevel, cfg.Lnd.LogWriter,
)
debuglevel = cfg.Remote.LitDebugLevel
}

// By default, we don't want the GRPC connection-level logger to be
// turned on. So if it isn't specifically mentioned in the debug level
// string, we'll disable it.
if !strings.Contains(debuglevel, GrpcLogSubsystem) {
debuglevel += fmt.Sprintf(",%s=off", GrpcLogSubsystem)
}

err = build.ParseAndSetDebugLevels(debuglevel, cfg.Lnd.LogWriter)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 05fc878

Please sign in to comment.