Reintroduce a feature flag to disable the activity log entirely. (#10288)

* Reintroduce a feature flag to disable the activity log entirely.
* Add log message when disabled.
This commit is contained in:
Mark Gritter 2020-10-30 16:27:35 -07:00 committed by GitHub
parent 6cd07b91c1
commit 7f01a58aee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -857,10 +857,16 @@ func (a *ActivityLog) queriesAvailable(ctx context.Context) (bool, error) {
// setupActivityLog hooks up the singleton ActivityLog into Core.
func (c *Core) setupActivityLog(ctx context.Context) error {
view := c.systemBarrierView.SubView(activitySubPath)
logger := c.baseLogger.Named("activity")
c.AddLogger(logger)
if os.Getenv("VAULT_DISABLE_ACTIVITY_LOG") != "" {
logger.Info("activity log disabled via environment variable")
return nil
}
view := c.systemBarrierView.SubView(activitySubPath)
manager, err := NewActivityLog(c, logger, view, c.metricSink)
if err != nil {
return err