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).
This commit is contained in:
Oliver Gugger 2024-11-07 10:20:11 +01:00
parent cb6977ff2d
commit 05fc878191
No known key found for this signature in database
GPG key ID: 8E4256593F177720

View file

@ -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
}