예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarAppender"/> class.
        /// </summary>
        /// <param name="rollbarConfig">The Rollbar configuration.</param>
        /// <param name="rollbarBlockingLoggingTimeout">The Rollbar blocking logging timeout.</param>
        public RollbarAppender(
            IRollbarConfig rollbarConfig,
            TimeSpan?rollbarBlockingLoggingTimeout
            )
        {
            this._rollbarConfig = rollbarConfig;

            RollbarFactory.CreateProper(
                this._rollbarConfig,
                rollbarBlockingLoggingTimeout,
                out this._rollbarAsyncLogger,
                out this._rollbarLogger
                );
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarAppender"/> class.
        /// </summary>
        public RollbarAppender()
        {
            RollbarConfig rollbarConfig = new RollbarConfig("just_a_seed_value");

#if NETSTANDARD
            Rollbar.NetCore.AppSettingsUtil.LoadAppSettings(ref rollbarConfig);
#endif
            this._rollbarConfig = rollbarConfig;
            RollbarFactory.CreateProper(
                this._rollbarConfig,
                TimeSpan.FromSeconds(rollbarTimeoutSeconds),
                out this._rollbarAsyncLogger,
                out this._rollbarLogger
                );
        }
예제 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PlugInCoreBase"/> class.
        /// </summary>
        /// <param name="rollbarConfig">The rollbar configuration.</param>
        /// <param name="rollbarBlockingTimeout">The rollbar blocking timeout.</param>
        protected PlugInCoreBase(
            IRollbarConfig rollbarConfig,
            TimeSpan?rollbarBlockingTimeout
            )
        {
            this._rollbarConfig = rollbarConfig;

            if (this._rollbarConfig == null)
            {
                IRollbarConfig config =
                    NetStandard.RollbarConfigUtility.LoadRollbarConfig();

                this._rollbarConfig = config;
            }

            this._rollbarLogger =
                RollbarFactory.CreateProper(this._rollbarConfig, rollbarBlockingTimeout);
        }
예제 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarSink"/> class.
        /// </summary>
        /// <param name="rollbarConfig">The Rollbar configuration.</param>
        /// <param name="rollbarBlockingLoggingTimeout">The Rollbar blocking logging timeout.</param>
        /// <param name="formatProvider">The format provider.</param>
        public RollbarSink(
            IRollbarConfig rollbarConfig,
            TimeSpan?rollbarBlockingLoggingTimeout,
            IFormatProvider formatProvider
            )
        {
            this._rollbarConfig = rollbarConfig;

            IRollbar rollbar = RollbarFactory.CreateNew().Configure(this._rollbarConfig);

            RollbarFactory.CreateProper(
                this._rollbarConfig,
                rollbarBlockingLoggingTimeout,
                out this._rollbarAsyncLogger,
                out this._rollbarLogger
                );

            _formatProvider = formatProvider;
        }
예제 #5
0
 protected override void InitializeTarget()
 {
     RollbarFactory.CreateProper(RollbarConfig, BlockingLoggingTimeout, out _rollbarAsyncLogger, out _rollbarLogger);
     base.InitializeTarget();
 }