code: func (a *AuditLogConfig) CheckAndSetDefaults() error {
  	if a.DataDir == "" {
  		return trace.BadParameter("missing parameter DataDir")
  	}
  	if a.ServerID == "" {
  		return trace.BadParameter("missing parameter ServerID")
  	}
  	if a.Clock == nil {
  		a.Clock = clockwork.NewRealClock()
  	}
  	if a.UIDGenerator == nil {
  		a.UIDGenerator = utils.NewRealUID()
  	}
  	if a.RotationPeriod == 0 {
  		a.RotationPeriod = defaults.LogRotationPeriod
  	}
  	if a.SessionIdlePeriod == 0 {
  		a.SessionIdlePeriod = defaults.SessionIdlePeriod
  	}
  	if a.DirMask == nil {
  		mask := os.FileMode(teleport.DirMaskSharedGroup)
  		a.DirMask = &mask
  	}
  	if (a.GID != nil && a.UID == nil) || (a.UID != nil && a.GID == nil) {
  		return trace.BadParameter("if UID or GID is set, both should be specified")
  	}
  	if a.PlaybackRecycleTTL == 0 {
  		a.PlaybackRecycleTTL = defaults.PlaybackRecycleTTL
  	}
  	if a.Context == nil {
  		a.Context = context.Background()
  	}
  	return nil
  }
docs: // CheckAndSetDefaults checks and sets defaults