core/logging: change log.Error function (#5251)

* core/logging: change log.Error function

* use request id
This commit is contained in:
Caleb Doxsey 2024-09-05 15:42:46 -06:00 committed by GitHub
parent 97bf5edc54
commit dad954ae16
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 163 additions and 166 deletions

View file

@ -102,7 +102,7 @@ func (src *ConfigSource) rebuild(ctx context.Context, firstTime firstTime) {
err := src.buildNewConfigLocked(ctx, cfg)
if err != nil {
health.ReportError(health.BuildDatabrokerConfig, err)
log.Error(ctx).Err(err).Msg("databroker: failed to build new config")
log.Ctx(ctx).Error().Err(err).Msg("databroker: failed to build new config")
return
}
health.ReportOK(health.BuildDatabrokerConfig)
@ -147,7 +147,7 @@ func (src *ConfigSource) buildNewConfigLocked(ctx context.Context, cfg *config.C
policies, errs = errgrouputil.Build(ctx, policyBuilders...)
if len(errs) > 0 {
for _, err := range errs {
log.Error(ctx).Msg(err.Error())
log.Ctx(ctx).Error().Msg(err.Error())
}
return fmt.Errorf("error building policies")
}
@ -262,7 +262,7 @@ func (src *ConfigSource) runUpdater(cfg *config.Config) {
cc, err := src.outboundGRPCConnection.Get(ctx, connectionOptions)
if err != nil {
log.Error(ctx).Err(err).Msg("databroker: failed to create gRPC connection to data broker")
log.Ctx(ctx).Error().Err(err).Msg("databroker: failed to create gRPC connection to data broker")
return
}
@ -312,7 +312,7 @@ func (s *syncerHandler) UpdateRecords(ctx context.Context, _ uint64, records []*
var cfgpb configpb.Config
err := record.GetData().UnmarshalTo(&cfgpb)
if err != nil {
log.Error(ctx).Err(err).Msg("databroker: error decoding config")
log.Ctx(ctx).Error().Err(err).Msg("databroker: error decoding config")
delete(s.src.dbConfigs, record.GetId())
continue
}