mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
logging: Add subsystem to log API (#19002)
Create new code paths for multiple subsystems in the code. This will make maintaing this easier later. Also introduce bugLogIf() for errors that should not happen in the first place.
This commit is contained in:
@@ -30,6 +30,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
logSubsys = "notify"
|
||||
|
||||
// The maximum allowed number of concurrent Send() calls to all configured notifications targets
|
||||
maxConcurrentAsyncSend = 50000
|
||||
)
|
||||
@@ -290,7 +292,7 @@ func (list *TargetList) sendSync(event Event, targetIDset TargetIDSet) {
|
||||
list.incFailedEvents(id)
|
||||
reqInfo := &logger.ReqInfo{}
|
||||
reqInfo.AppendTags("targetID", id.String())
|
||||
logger.LogOnceIf(logger.SetReqInfo(context.Background(), reqInfo), err, id.String())
|
||||
logger.LogOnceIf(logger.SetReqInfo(context.Background(), reqInfo), logSubsys, err, id.String())
|
||||
}
|
||||
}(id, target)
|
||||
}
|
||||
@@ -313,7 +315,7 @@ func (list *TargetList) sendAsync(event Event, targetIDset TargetIDSet) {
|
||||
for id := range targetIDset {
|
||||
reqInfo := &logger.ReqInfo{}
|
||||
reqInfo.AppendTags("targetID", id.String())
|
||||
logger.LogOnceIf(logger.SetReqInfo(context.Background(), reqInfo), err, id.String())
|
||||
logger.LogOnceIf(logger.SetReqInfo(context.Background(), reqInfo), logSubsys, err, id.String())
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user