MM-22784 Advanced logging config for audit (#15076)
Adds the advanced logging config for audit. Existing support for auditing to a single file remains for E0 and E10 licenses instances, and a new config item ExperimentalAuditSettings.AdvancedLoggingConfig is added that behaves like LogSettings.AdvancedLoggingConfig. Supported destinations: - file - syslog (with out without TLS) - raw TCP socket (with out without TLS) ExperimentalAuditSettings.AdvancedLoggingConfig can contain a filespec to a config file, a database DSN, or JSON. Co-authored-by: Mattermod <mattermod@users.noreply.github.com> Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Этот коммит содержится в:
@@ -459,13 +459,17 @@ func NewServer(options ...Option) (*Server, error) {
|
||||
|
||||
s.ReloadConfig()
|
||||
|
||||
allowAdvancedLogging := license != nil && *license.Features.AdvancedLogging
|
||||
|
||||
if s.Audit == nil {
|
||||
s.Audit = &audit.Audit{}
|
||||
s.Audit.Init(audit.DefMaxQueueSize)
|
||||
s.configureAudit(s.Audit)
|
||||
if err := s.configureAudit(s.Audit, allowAdvancedLogging); err != nil {
|
||||
mlog.Error("Error configuring audit", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
if license == nil || !*license.Features.AdvancedLogging {
|
||||
if !allowAdvancedLogging {
|
||||
timeoutCtx, cancelCtx := context.WithTimeout(context.Background(), time.Second*5)
|
||||
defer cancelCtx()
|
||||
mlog.Info("Shutting down advanced logging")
|
||||
|
||||
Ссылка в новой задаче
Block a user