mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -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:
@@ -367,7 +367,7 @@ func serverHandleCmdArgs(ctxt serverCtxt) {
|
||||
RoundTripper: NewHTTPTransportWithTimeout(1 * time.Hour),
|
||||
Logger: func(err error) {
|
||||
if err != nil && !errors.Is(err, context.Canceled) {
|
||||
logger.LogIf(GlobalContext, err)
|
||||
replLogIf(GlobalContext, err)
|
||||
}
|
||||
},
|
||||
})
|
||||
@@ -577,7 +577,7 @@ func initConfigSubsystem(ctx context.Context, newObject ObjectLayer) error {
|
||||
}
|
||||
|
||||
// Any other config errors we simply print a message and proceed forward.
|
||||
logger.LogIf(ctx, fmt.Errorf("Unable to initialize config, some features may be missing: %w", err))
|
||||
configLogIf(ctx, fmt.Errorf("Unable to initialize config, some features may be missing: %w", err))
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -777,7 +777,7 @@ func serverMain(ctx *cli.Context) {
|
||||
httpServer.TCPOptions.Trace = bootstrapTraceMsg
|
||||
go func() {
|
||||
serveFn, err := httpServer.Init(GlobalContext, func(listenAddr string, err error) {
|
||||
logger.LogIf(GlobalContext, fmt.Errorf("Unable to listen on `%s`: %v", listenAddr, err))
|
||||
bootLogIf(GlobalContext, fmt.Errorf("Unable to listen on `%s`: %v", listenAddr, err))
|
||||
})
|
||||
if err != nil {
|
||||
globalHTTPServerErrorCh <- err
|
||||
@@ -839,7 +839,7 @@ func serverMain(ctx *cli.Context) {
|
||||
logger.FatalIf(err, "Server startup canceled upon user request")
|
||||
}
|
||||
|
||||
logger.LogIf(GlobalContext, err)
|
||||
bootLogIf(GlobalContext, err)
|
||||
}
|
||||
|
||||
if !globalServerCtxt.StrictS3Compat {
|
||||
@@ -935,14 +935,14 @@ func serverMain(ctx *cli.Context) {
|
||||
// Initialize transition tier configuration manager
|
||||
bootstrapTrace("globalTierConfigMgr.Init", func() {
|
||||
if err := globalTierConfigMgr.Init(GlobalContext, newObject); err != nil {
|
||||
logger.LogIf(GlobalContext, err)
|
||||
bootLogIf(GlobalContext, err)
|
||||
}
|
||||
})
|
||||
}()
|
||||
|
||||
// Initialize bucket notification system.
|
||||
bootstrapTrace("initBucketTargets", func() {
|
||||
logger.LogIf(GlobalContext, globalEventNotifier.InitBucketTargets(GlobalContext, newObject))
|
||||
bootLogIf(GlobalContext, globalEventNotifier.InitBucketTargets(GlobalContext, newObject))
|
||||
})
|
||||
|
||||
var buckets []BucketInfo
|
||||
@@ -956,7 +956,7 @@ func serverMain(ctx *cli.Context) {
|
||||
time.Sleep(time.Duration(r.Float64() * float64(time.Second)))
|
||||
continue
|
||||
}
|
||||
logger.LogIf(GlobalContext, fmt.Errorf("Unable to list buckets to initialize bucket metadata sub-system: %w", err))
|
||||
bootLogIf(GlobalContext, fmt.Errorf("Unable to list buckets to initialize bucket metadata sub-system: %w", err))
|
||||
}
|
||||
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user