[MM-54435] Use annotated logger to capture compliance export logs (#24791)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fe6131caed
Коммит
d0c22aa1cd
@@ -6,6 +6,8 @@ package model
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/shared/mlog"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -123,3 +125,17 @@ func (c *Compliance) IsValid() *AppError {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// LoggerFields returns the logger annotations reflecting the given compliance job metadata.
|
||||
func (c *Compliance) LoggerFields() []mlog.Field {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
return []mlog.Field{
|
||||
mlog.String("job_id", c.Id),
|
||||
mlog.String("job_type", c.Type),
|
||||
mlog.String("job_name", c.JobName()),
|
||||
mlog.Millis("job_create_at", c.CreateAt),
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user