log: Add logger.Event to send to console and other logger targets (#19060)

Add a new function logger.Event() to send the log to Console and
http/kafka log webhooks. This will include some internal events such as
disk healing and rebalance/decommissioning
This commit is contained in:
Anis Eleuch
2024-02-16 00:13:30 +01:00
committed by GitHub
parent f9dbf41e27
commit 68dde2359f
12 changed files with 71 additions and 39 deletions

View File

@@ -478,7 +478,7 @@ func bootstrapTraceMsg(msg string) {
globalBootstrapTracer.Record(info)
if serverDebugLog {
logger.Info(fmt.Sprint(time.Now().Round(time.Millisecond).Format(time.RFC3339), " bootstrap: ", msg))
fmt.Println(time.Now().Round(time.Millisecond).Format(time.RFC3339), " bootstrap: ", msg)
}
noSubs := globalTrace.NumSubscribers(madmin.TraceBootstrap) == 0
@@ -491,7 +491,7 @@ func bootstrapTraceMsg(msg string) {
func bootstrapTrace(msg string, worker func()) {
if serverDebugLog {
logger.Info(fmt.Sprint(time.Now().Round(time.Millisecond).Format(time.RFC3339), " bootstrap: ", msg))
fmt.Println(time.Now().Round(time.Millisecond).Format(time.RFC3339), " bootstrap: ", msg)
}
now := time.Now()
@@ -1031,8 +1031,8 @@ func serverMain(ctx *cli.Context) {
globalMinioClient.SetAppInfo("minio-perf-test", ReleaseTag)
if serverDebugLog {
logger.Info("== DEBUG Mode enabled ==")
logger.Info("Currently set environment settings:")
fmt.Println("== DEBUG Mode enabled ==")
fmt.Println("Currently set environment settings:")
ks := []string{
config.EnvAccessKey,
config.EnvSecretKey,
@@ -1044,9 +1044,9 @@ func serverMain(ctx *cli.Context) {
if slices.Contains(ks, strings.Split(v, "=")[0]) {
continue
}
logger.Info(v)
fmt.Println(v)
}
logger.Info("======")
fmt.Println("======")
}
daemon.SdNotify(false, daemon.SdNotifyReady)