Exemple #1
0
        public static IAppBuilder UseRaygun(this IAppBuilder builder, Action <RaygunOptions> configuration)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            var options = new RaygunOptions();

            configuration(options);

            return(UseRaygun(builder, options));
        }
Exemple #2
0
        public static IAppBuilder UseRaygun(this IAppBuilder builder, RaygunOptions options = null)
        {
            if (builder == null)
            {
                throw new ArgumentNullException("builder");
            }

            var raygunOptions = options ?? new RaygunOptions();

            if (raygunOptions.LogUnhandledExceptions)
            {
                builder.Use(typeof(RaygunUnhandledExceptionMiddleware), raygunOptions.Settings);
            }

            if (raygunOptions.LogUnhandledRequests)
            {
                builder.Use(typeof(RaygunUnhandledRequestMiddleware), raygunOptions.Settings);
            }

            SetRaygunCapabilities(builder.Properties);

            return(builder);
        }