MindscapeHQ / raygun4net

Raygun provider for .NET
https://raygun.com
MIT License
126 stars 93 forks source link

Http Information about the error is not showned in asp.net core #383

Closed davidrevoledo closed 6 years ago

davidrevoledo commented 6 years ago

A webapp is being migrated from asp.net to asp.net core and we're using Raygun to log all the crashes, but with asp.net the error are logged with the http information about the request automatically with any configurations, showing the url, the http type and even the headers, cookies values.

This doesn't have the same behavior with asp.net core where the Http is not showned

The code to log exceptions is the same in both :

      new RaygunClient(ConfigurationsUtils.Configuration["ApiRaygunApiKey"]).SendInBackground(exception,
                null,
                information); // this is the custom dictionary

Thanks in advance :)

j5alive commented 6 years ago

Hi @davidrevoledo sorry for the late input here, but with ASP.NET Core the HttpContext is not exposed in the same way as full framework ASP.NET, so we've provided a way to pass the HttpContext to the client when sending errors manually. I'd suggest you have a read of this https://raygun.com/docs/languages/net/aspnetcore#raygun-middleware specifically how to inject the IRaygunAspNetCoreClientProvider instance into your controllers.

davidrevoledo commented 6 years ago

@j5alive I did it manually with the HttpContextAccesor and custom data. thanks