-
Notifications
You must be signed in to change notification settings - Fork 32
500 errors not logging #29
Comments
Thanks for the report. I haven't encountered this, may need some investigation. Help welcome, if you're able to build from source and take a look. Which Serilog version are you running, and to which sink(s)? Thanks! |
I am using the Seq sink. I was using outdated versions of these packages. I have now updated them and am using Serilog 2.2.1 and Serilog.Sinks.Seq 3.0.1. The 500 errors are now coming through on Seq but have no exception data and are only logging as Information level, which is not very helpful as it has no context of the error (stack trace/line numbers etc). |
Sounds like progress! Glad to hear you have some data captured now. Can you please send an example of one of the events received at Seq? Particularly the message associated with the event - redacted if necessary of course. Any information about associated properties on the event would also help to debug this on this end. Thanks! |
Thanks for the info. I think what's probably happening here (at a guess) is that another handler/exception filter is handling the exception. Are there any other error-handling paths that might prevent the exception from bubbling up? I've just merged #31 to switch the level to Error appropriately in this scenario, if you have a chance to grab the 2.0.10 build and check it out. |
Thanks for the speedy fix for that, seems to be logging with Error level now for 500 server errors, even with no exception data. Regarding capturing exception data, I am using the setup in web.config. I have worked out just now that exception info is captured for local requests but not remote ones. Any ideas what may be causing this? I though maybe there was a in the web.config, but it's not in there. |
I have found a solution. Adding customErrors Off like the below works. I have errors handled using IIS httpErrors still so it isn't showing the user any exception details. I tried setting customErrors to On and there is no exception info locally or remotely, DetailedLocal shows the original problem of exceptions locally and not remotely and Off shows exceptions for both. I guess the solution is to make sure customErrors is set to Off!
|
Thanks for the update. Looking into it further, it seems like generic error handling and |
Hi @drjaydenm I have same issue I had to turn off custom errors in web.config: But the IIS error pages are not working for me, could you plase share your web.config? |
I had to use httpErrors over custom errors for it to work correctly. The httpErrors work more at the IIS level than at the ASP level. You can read more about it here https://www.iis.net/configreference/system.webserver/httperrors |
This project is no longer being maintained and we are going to archive the SerilogWeb Repositories. see: |
I am using version 2.0.9 of this component to log an ASP.NET MVC 5 application. It is working correctly, however does not log any 500 Internal server errors. All exceptions for other HTTP error codes are caught (400, 404 etc). Is there anything that may stop the logging of these 500 errors? Does an unhandled exception handler need to be setup at all? The app is fairly standard configuration wise.
The text was updated successfully, but these errors were encountered: