-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CBG-3975: Configuration wiring for audit logging and /db/_config APIs #6918
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,17 +90,22 @@ func GenerateDatabaseConfigVersionID(ctx context.Context, previousRevID string, | |
} | ||
|
||
func DefaultPerDBLogging(bootstrapLoggingCnf base.LoggingConfig) *DbLoggingConfig { | ||
dblc := &DbLoggingConfig{} | ||
if bootstrapLoggingCnf.Console != nil { | ||
if *bootstrapLoggingCnf.Console.Enabled { | ||
return &DbLoggingConfig{ | ||
Console: &DbConsoleLoggingConfig{ | ||
LogLevel: bootstrapLoggingCnf.Console.LogLevel, | ||
LogKeys: bootstrapLoggingCnf.Console.LogKeys, | ||
}, | ||
dblc.Console = &DbConsoleLoggingConfig{ | ||
LogLevel: bootstrapLoggingCnf.Console.LogLevel, | ||
LogKeys: bootstrapLoggingCnf.Console.LogKeys, | ||
} | ||
} | ||
} | ||
return &DbLoggingConfig{} | ||
if bootstrapLoggingCnf.Audit != nil { | ||
dblc.Audit = &DbAuditLoggingConfig{ | ||
Enabled: base.BoolPtr(false), | ||
EnabledEvents: base.DefaultAuditEventIDs, | ||
} | ||
Comment on lines
+103
to
+106
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would have expected these to inherit the value from the bootstrap and override if appropriate? Is this change specific to capella, since audit logging should be enabled globally, but potentially turned off per database? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's anticipated that users will enable audit logging (globally), and then opt-into databases one at a time where required. Enabling globally then disabling subsets of databases creates unnessesary audit work/noise for the sake of one extra API call. It's expected that users will want to customise their enabled audit events anyway. |
||
} | ||
return dblc | ||
} | ||
|
||
// MergeDatabaseConfigWithDefaults merges the passed in config onto a DefaultDbConfig which results in returned value | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this help a lot given that all the member of AuditLoggerConfig are pointers and this is a shallow copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't seem nessesary since there's no runtime configuration beyond the embedded FileLoggerConfig (yet), but I think I'd rather just keep this here in case we do add runtime-configurable options to
auditLogger
. Follows the same pattern as console and file loggers.