INNER CODE UNIT · Go
func
minio/kes · audit.go:91
func (a *AuditLogHandler) Enabled(ctx context.Context, level slog.Level) bool {
return a.Handler.Enabled(ctx, level)
}
// Handle converts the AuditRecord to an slog.Record and
// passes it to the underlying handler.
func (a *AuditLogHandler) Handle(ctx context.Context, r AuditRecord) error {
rec := slog.Record{
Time: r.Time,
Message: r.Message,
Level: r.Level,
}
rec.AddAttrs(
slog.Attr{Key: "req", Value: slog.GroupValue(
slog.String("method", r.Method),
slog.String("path", r.Path),
slog.String("ip", r.RemoteIP.String()),
slog.String("identity", r.Identity.String()),