diff --git a/rest/admin_api.go b/rest/admin_api.go index 8718a706b4..564b88687f 100644 --- a/rest/admin_api.go +++ b/rest/admin_api.go @@ -788,6 +788,13 @@ func (h *handler) handlePutDbAuditConfig() error { return base.HTTPErrorf(http.StatusBadRequest, "couldn't update audit configuration: %s", err) } + if config.Logging == nil { + config.Logging = &DbLoggingConfig{} + } + if config.Logging.Audit == nil { + config.Logging.Audit = &DbAuditLoggingConfig{} + } + if isReplace || body.Enabled != nil { config.Logging.Audit.Enabled = body.Enabled }