Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RollbarHttpContextPackageDecorator"/> class.
 /// </summary>
 /// <param name="packageToDecorate">The package to decorate.</param>
 /// <param name="rollbarHttpContext">The rollbar HTTP context.</param>
 public RollbarHttpContextPackageDecorator(
     IRollbarPackage packageToDecorate,
     RollbarHttpContext rollbarHttpContext
     )
     : this(packageToDecorate, rollbarHttpContext, false)
 {
 }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RollbarHttpContextPackageDecorator"/> class.
 /// </summary>
 /// <param name="packageToDecorate">The package to decorate.</param>
 /// <param name="rollbarHttpContext">The rollbar HTTP context.</param>
 /// <param name="mustApplySynchronously">if set to <c>true</c> [must apply synchronously].</param>
 public RollbarHttpContextPackageDecorator(
     IRollbarPackage packageToDecorate,
     RollbarHttpContext rollbarHttpContext,
     bool mustApplySynchronously
     )
     : base(packageToDecorate, mustApplySynchronously)
 {
     this._rollbarHttpContext = rollbarHttpContext;
 }
Esempio n. 3
0
        /// <summary>
        /// Extracts the custom request fields.
        /// </summary>
        /// <param name="rollbarHttpContext">
        /// The rollbar HTTP context.
        /// </param>
        /// <returns>
        /// Dictionary&lt;System.String, System.Nullable&lt;System.Object&gt;&gt;.
        /// </returns>
        private static Dictionary <string, object?> ExtractCustomRequestFields(RollbarHttpContext rollbarHttpContext)
        {
            Dictionary <string, object?> customRequestFields = new();

            customRequestFields.Add("httpRequestTimestamp", rollbarHttpContext.Timestamp);

            if (rollbarHttpContext.HttpAttributes != null)
            {
                customRequestFields.Add("httpRequestID", rollbarHttpContext.HttpAttributes.RequestID);
                customRequestFields.Add("scheme", rollbarHttpContext.HttpAttributes.RequestScheme);
                customRequestFields.Add("protocol", rollbarHttpContext.HttpAttributes.RequestProtocol);
                customRequestFields.Add("statusCode", rollbarHttpContext.HttpAttributes.ResponseStatusCode);
            }

            return(customRequestFields);
        }