コード例 #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RollbarLogger" /> class.
 /// </summary>
 /// <param name="name">The name.</param>
 /// <param name="rollbarConfig">The rollbar configuration.</param>
 /// <param name="rollbarOptions">The options.</param>
 /// <param name="httpContextAccessor">The HTTP context accessor.</param>
 public RollbarLogger(string name
                      , IRollbarConfig rollbarConfig
                      , NetPlatformExtensions.RollbarOptions rollbarOptions
                      , IHttpContextAccessor httpContextAccessor
                      )
     : base(name, rollbarConfig, rollbarOptions)
 {
     this._httpContextAccessor = httpContextAccessor;
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RollbarMiddleware" /> class.
        /// </summary>
        /// <param name="nextRequestProcessor">The next request processor.</param>
        /// <param name="configuration">The configuration.</param>
        /// <param name="loggerFactory">The logger factory.</param>
        /// <param name="rollbarOptions">The rollbar options.</param>
        public RollbarMiddleware(
            RequestDelegate nextRequestProcessor
            , IConfiguration configuration
            , ILoggerFactory loggerFactory
            , IOptions <NetPlatformExtensions.RollbarOptions> rollbarOptions
            )
        {
            this._nextRequestProcessor = nextRequestProcessor;
            this._logger         = loggerFactory.CreateLogger <RollbarMiddleware>();
            this._rollbarOptions = rollbarOptions.Value;

            RollbarConfigurationUtil.DeduceRollbarTelemetryConfig(configuration);
            TelemetryCollector.Instance.StartAutocollection();
            RollbarConfigurationUtil.DeduceRollbarConfig(configuration);
        }