private static void InitializeGlobalConfigIfRequired()
 {
     lock (BaseDirectoryProtocolLog.globalLock)
     {
         if (BaseDirectoryProtocolLog.bufferSize == 0 || BaseDirectoryProtocolLog.loggingEnabled == null)
         {
             BaseDirectoryProtocolLog.ReadGlobalConfig();
             AppDomain.CurrentDomain.ProcessExit += delegate(object x, EventArgs y)
             {
                 BaseDirectoryProtocolLog.loggingEnabled = new bool?(false);
                 if (BaseDirectoryProtocolLog.timer != null)
                 {
                     BaseDirectoryProtocolLog.timer.Dispose();
                 }
             };
         }
         if (BaseDirectoryProtocolLog.registryWatcher == null)
         {
             BaseDirectoryProtocolLog.registryWatcher = new RegistryWatcher("SYSTEM\\CurrentControlSet\\Services\\MSExchange ADAccess\\Parameters", false);
         }
         if (BaseDirectoryProtocolLog.timer == null)
         {
             BaseDirectoryProtocolLog.timer = new Timer(new TimerCallback(BaseDirectoryProtocolLog.GlobalUpdateConfigIfChanged), null, 0, 300000);
         }
     }
 }
 // Token: 0x060009CA RID: 2506 RVA: 0x0002C040 File Offset: 0x0002A240
 private void ReadConfigData()
 {
     using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\MSExchange ADAccess\\Parameters"))
     {
         this.protocolLogDisabled = BaseDirectoryProtocolLog.GetRegistryBool(registryKey, "CacheProtocolLogDisabled", false);
     }
 }
 // Token: 0x060009C8 RID: 2504 RVA: 0x0002BFB8 File Offset: 0x0002A1B8
 private void Initialize()
 {
     lock (this.logLock)
     {
         if (!base.Initialized)
         {
             this.ReadConfigData();
             base.Initialize(ExDateTime.UtcNow, Path.Combine(BaseDirectoryProtocolLog.GetExchangeInstallPath(), "Logging\\DirCache\\"), BaseDirectoryProtocolLog.DefaultMaxRetentionPeriod, BaseDirectoryProtocolLog.DefaultDirectorySizeQuota, BaseDirectoryProtocolLog.DefaultPerFileSizeQuota, true, "DirCacheLogs");
         }
     }
 }
 // Token: 0x060009B7 RID: 2487 RVA: 0x0002BB44 File Offset: 0x00029D44
 private void Initialize()
 {
     lock (this.logLock)
     {
         if (!base.Initialized)
         {
             base.Initialize(ExDateTime.UtcNow, Path.Combine(BaseDirectoryProtocolLog.GetExchangeInstallPath(), "Logging\\ADScenario\\"), BaseDirectoryProtocolLog.DefaultMaxRetentionPeriod, BaseDirectoryProtocolLog.DefaultDirectorySizeQuota, BaseDirectoryProtocolLog.DefaultPerFileSizeQuota, true, "ADScenarioLogs");
         }
     }
     this.protocolLogDisabled = true;
 }
        private static void ReadGlobalConfig()
        {
            BaseDirectoryProtocolLog.bufferSize = Globals.GetIntValueFromRegistry("SYSTEM\\CurrentControlSet\\Services\\MSExchange ADAccess\\Parameters", "LogBufferSize", 1048576, 0);
            int intValueFromRegistry = Globals.GetIntValueFromRegistry("SYSTEM\\CurrentControlSet\\Services\\MSExchange ADAccess\\Parameters", "FlushIntervalInMinutes", 15, 0);

            if (intValueFromRegistry > 0)
            {
                BaseDirectoryProtocolLog.DefaultFlushInterval = TimeSpan.FromMinutes((double)intValueFromRegistry);
            }
            using (RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\MSExchange ADAccess\\Parameters"))
            {
                BaseDirectoryProtocolLog.loggingEnabled = new bool?(BaseDirectoryProtocolLog.GetRegistryBool(registryKey, "ProtocolLoggingEnabled", true));
            }
        }
 private static void GlobalUpdateConfigIfChanged(object state)
 {
     if (BaseDirectoryProtocolLog.registryWatcher.IsChanged())
     {
         bool flag = false;
         using (Registry.LocalMachine.OpenSubKey("SYSTEM\\CurrentControlSet\\Services\\MSExchange ADAccess\\Parameters"))
         {
             bool value = BaseDirectoryProtocolLog.loggingEnabled.Value;
             BaseDirectoryProtocolLog.ReadGlobalConfig();
             flag = (value != BaseDirectoryProtocolLog.loggingEnabled.Value);
         }
         TimerCallback timerCallback = BaseDirectoryProtocolLog.callsBacks;
         if (timerCallback != null)
         {
             timerCallback(flag);
         }
     }
 }
 protected void Initialize(ExDateTime serviceStartTime, string logFilePath, TimeSpan maxRetentionPeriond, ByteQuantifiedSize directorySizeQuota, ByteQuantifiedSize perFileSizeQuota, bool applyHourPrecision, string logComponent)
 {
     if (this.Initialized)
     {
         throw new NotSupportedException("Protocol Log is already initialized");
     }
     BaseDirectoryProtocolLog.InitializeGlobalConfigIfRequired();
     if (this.log == null)
     {
         this.log = new Log(BaseDirectoryProtocolLog.logFilePrefix, new LogHeaderFormatter(this.Schema, LogHeaderCsvOption.CsvCompatible), logComponent);
         AppDomain.CurrentDomain.ProcessExit += this.CurrentDomainProcessExit;
     }
     if (BaseDirectoryProtocolLog.loggingEnabled.Value)
     {
         this.log.Configure(logFilePath, maxRetentionPeriond, (long)directorySizeQuota.ToBytes(), (long)perFileSizeQuota.ToBytes(), applyHourPrecision, BaseDirectoryProtocolLog.bufferSize, BaseDirectoryProtocolLog.DefaultFlushInterval, LogFileRollOver.Hourly);
     }
     BaseDirectoryProtocolLog.callsBacks = (TimerCallback)Delegate.Combine(BaseDirectoryProtocolLog.callsBacks, new TimerCallback(this.UpdateConfigIfChanged));
     this.Initialized = true;
 }