internal GccProtocolActivityLoggerConfig(bool disabled, string logRoot)
        {
            NameValueCollection appSettings = ConfigurationManager.AppSettings;

            this.disabled                   = disabled;
            this.maxAge                     = GccProtocolActivityLoggerConfig.ParseConfigValue(appSettings, "GccLogMaxAge", GccProtocolActivityLoggerConfig.DefaultMaxAge);
            this.maxDirectorySize           = GccProtocolActivityLoggerConfig.ParseConfigValue(appSettings, "GccLogMaxDirectorySize", long.MaxValue);
            this.maxLogfileSize             = GccProtocolActivityLoggerConfig.ParseConfigValue(appSettings, "GccLogMaxLogfileSize", long.MaxValue);
            this.reportIntervalMilliseconds = GccProtocolActivityLoggerConfig.ParseConfigValue(appSettings, "GccReportIntervalMilliseconds", 60000.0);
            if (logRoot == null)
            {
                try
                {
                    this.logRoot = (string)(Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\ExchangeServer\\v15", "GccLogRoot", null) ?? string.Empty);
                    goto IL_B5;
                }
                catch
                {
                    this.logRoot = string.Empty;
                    goto IL_B5;
                }
            }
            this.logRoot = logRoot;
IL_B5:
            if (!this.disabled && this.logRoot.Length == 0)
            {
                ExTraceGlobals.StorageTracer.TraceError((long)this.GetHashCode(), "No GccLogRoot regkey was found - Criminal Compliance logging disabled");
                this.disabled = true;
            }
            try
            {
                if (!this.disabled && !Path.IsPathRooted(this.logRoot))
                {
                    ExTraceGlobals.StorageTracer.TraceError((long)this.GetHashCode(), "GccLogRoot contains a relative path, must be absolute - Criminal Compliance logging disabled");
                    this.disabled = true;
                }
            }
            catch (ArgumentException)
            {
                ExTraceGlobals.StorageTracer.TraceError((long)this.GetHashCode(), "GccLogRoot contains invalid path characters - Criminal Compliance logging disabled");
                this.disabled = true;
            }
        }
 public GccProtocolActivityLoggerConfig() : this(GccProtocolActivityLoggerConfig.ParseConfigValue(ConfigurationManager.AppSettings, "GccDisabled", true), null)
 {
 }