Beispiel #1
0
        public RaygunClient(RaygunSettings settings, HttpContext context = null)
            : base(settings)
        {
            if (settings.IgnoreFormFieldNames != null)
            {
                var ignoredNames = settings.IgnoreFormFieldNames;
                IgnoreFormFieldNames(ignoredNames);
            }
            if (settings.IgnoreHeaderNames != null)
            {
                var ignoredNames = settings.IgnoreHeaderNames;
                IgnoreHeaderNames(ignoredNames);
            }
            if (settings.IgnoreCookieNames != null)
            {
                var ignoredNames = settings.IgnoreCookieNames;
                IgnoreCookieNames(ignoredNames);
            }
            if (settings.IgnoreServerVariableNames != null)
            {
                var ignoredNames = settings.IgnoreServerVariableNames;
                IgnoreServerVariableNames(ignoredNames);
            }
            if (!string.IsNullOrEmpty(settings.ApplicationVersion))
            {
                ApplicationVersion = settings.ApplicationVersion;
            }
            IsRawDataIgnored = settings.IsRawDataIgnored;

            if (context != null)
            {
                SetCurrentContext(context);
            }
        }
        public RaygunAspNetMiddleware(RequestDelegate next, IOptions <RaygunSettings> settings, RaygunMiddlewareSettings middlewareSettings)
        {
            _next = next;
            _middlewareSettings = middlewareSettings;

            _settings = _middlewareSettings.ClientProvider.GetRaygunSettings(settings.Value ?? new RaygunSettings());
        }
Beispiel #3
0
        public RaygunAspNetMiddleware(RequestDelegate next, IOptions <RaygunSettings> settings, RaygunMiddlewareSettings middlewareSettings)
        {
            _next = next;
            _middlewareSettings = middlewareSettings;

            _settings = _middlewareSettings.ClientProvider.GetRaygunSettings(settings.Value ?? new RaygunSettings());

            _aspNetCoreInitializer = new AspNetCoreInitializer();
            _aspNetCoreInitializer.Initialize(_settings.ApplicationIdentifier);
        }
Beispiel #4
0
        public RaygunClient(RaygunSettings settings, HttpContext context = null)
            : base(settings)
        {
            if (settings.IgnoreSensitiveFieldNames != null)
            {
                var ignoredNames = settings.IgnoreSensitiveFieldNames;
                IgnoreSensitiveFieldNames(ignoredNames);
            }

            if (settings.IgnoreQueryParameterNames != null)
            {
                var ignoredNames = settings.IgnoreQueryParameterNames;
                IgnoreQueryParameterNames(ignoredNames);
            }

            if (settings.IgnoreFormFieldNames != null)
            {
                var ignoredNames = settings.IgnoreFormFieldNames;
                IgnoreFormFieldNames(ignoredNames);
            }

            if (settings.IgnoreHeaderNames != null)
            {
                var ignoredNames = settings.IgnoreHeaderNames;
                IgnoreHeaderNames(ignoredNames);
            }

            if (settings.IgnoreCookieNames != null)
            {
                var ignoredNames = settings.IgnoreCookieNames;
                IgnoreCookieNames(ignoredNames);
            }

            if (settings.IgnoreServerVariableNames != null)
            {
                var ignoredNames = settings.IgnoreServerVariableNames;
                IgnoreServerVariableNames(ignoredNames);
            }

            if (!string.IsNullOrEmpty(settings.ApplicationVersion))
            {
                ApplicationVersion = settings.ApplicationVersion;
            }

            IsRawDataIgnored = settings.IsRawDataIgnored;
            IsRawDataIgnoredWhenFilteringFailed = settings.IsRawDataIgnoredWhenFilteringFailed;

            UseXmlRawDataFilter          = settings.UseXmlRawDataFilter;
            UseKeyValuePairRawDataFilter = settings.UseKeyValuePairRawDataFilter;

            if (context != null)
            {
                SetCurrentContext(context);
            }
        }
Beispiel #5
0
        protected override bool CanSend(RaygunMessage message)
        {
            if (message?.Details?.Response == null)
            {
                return(true);
            }

            RaygunSettings settings = GetSettings();

            if (settings.ExcludedStatusCodes == null)
            {
                return(true);
            }

            return(!settings.ExcludedStatusCodes.Contains(message.Details.Response.StatusCode));
        }
Beispiel #6
0
 public virtual RaygunSettings GetRaygunSettings(RaygunSettings baseSettings)
 {
     return(baseSettings);
 }
Beispiel #7
0
 public virtual RaygunClient GetClient(RaygunSettings settings, HttpContext context)
 {
     return(new RaygunClient(settings, context));
 }
Beispiel #8
0
 public virtual RaygunClient GetClient(RaygunSettings settings)
 {
     return(GetClient(settings, null));
 }