Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How to log the cause of 500 Internal Service Error with WebApi?

$
0
0

I have wired up console logging at the debug level but when an error occurs before my controller code is reached, all I get is a 500 Internal Service Error with no exceptions in the debugger, nothing in the output window, and nothing in the console logging.

One example of a problem that causes this is having an unregistered dependency in the Controller's constructor. There is no feedback that I have seen that helps me to troubleshoot this scenario. I've had others as well. Is there logging from the framework to which I can get access?

My logging config:

public Startup(IHostingEnvironment env, IApplicationEnvironment appEnv, ILoggerFactory loggerFactory)
{
	loggerFactory.MinimumLevel = LogLevel.Debug;
	loggerFactory.AddConsole(LogLevel.Debug);
}


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>