internal RollbarConfig(RollbarLogger logger)
        {
            this._logger = logger;

            this.SetDefaults();

            // initialize based on application configuration file (if any):
            var configLoader = new RollbarConfigurationLoader();

            configLoader.Load(this);
        }
        private void SetDefaults()
        {
            // let's set some default values:
            this.TelemetryEnabled                = false;
            this.TelemetryQueueDepth             = 5;
            this.TelemetryAutoCollectionTypes    = TelemetryType.None;
            this.TelemetryAutoCollectionInterval = TimeSpan.Zero;

            // initialize based on application configuration file (if any):
            var configLoader = new RollbarConfigurationLoader();

            configLoader.Load(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarLoggerConfig"/> class.
        /// </summary>
        /// <param name="logger">The logger.</param>
        internal RollbarLoggerConfig(IRollbar logger)
        {
            this._logger = logger;

            this.SetDefaults();

            // initialize based on application configuration file (if any):
            var configLoader = new RollbarConfigurationLoader();
            RollbarInfrastructureConfig config = new RollbarInfrastructureConfig();

            configLoader.Load(config);
            this.Reconfigure(config.RollbarLoggerConfig);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarConfig"/> class.
        /// </summary>
        /// <param name="accessToken">The access token.</param>
        public RollbarConfig(string accessToken)
        {
            this.SetDefaults();

            if (!string.IsNullOrWhiteSpace(accessToken))
            {
                this.AccessToken = accessToken;
            }
            else
            {
                // initialize based on application configuration file (if any):
                var configLoader = new RollbarConfigurationLoader();
                configLoader.Load(this);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarLoggerConfig" /> class.
        /// </summary>
        /// <param name="accessToken">The access token.</param>
        /// <param name="rollbarEnvironment">The rollbar environment.</param>
        public RollbarLoggerConfig(string?accessToken, string?rollbarEnvironment = null)
        {
            this.SetDefaults();

            if (!string.IsNullOrWhiteSpace(accessToken))
            {
                this._rollbarDestinationOptions.AccessToken = accessToken;
                if (!string.IsNullOrWhiteSpace(rollbarEnvironment))
                {
                    this._rollbarDestinationOptions.Environment = rollbarEnvironment;
                }
            }
            else
            {
                // initialize based on application configuration file (if any):
                var configLoader = new RollbarConfigurationLoader();
                RollbarInfrastructureConfig config = new RollbarInfrastructureConfig();
                configLoader.Load(config);
                this.Reconfigure(config.RollbarLoggerConfig);
            }
        }