dfmetro
dfmetro

Reputation: 4592

Why don't I get a error logs for 500 Interal Errors in my logs directory in ASP.NET Core

I have a 2 deployed ASP.NET Core RC1 web application based off the default asp.net core template.

Both work correctly.

However I touched the web.config of one as I wanted to restart the application and then I got the following error.

:( Oops. 500 Internal Server Error An error occurred while starting the application.

How do I troubleshoot why the application cannot start up? I reaplced it with the original web.config but I still get the error when I access the site URL.

I have 3 directories -approot -wwwroot -logs

Why is the logs directory empty when I get the error

I am using the default logging that was in an asp.net template

my appsettings.json

     "Logging": {
        "IncludeScopes": false,
        "LogLevel": {
          "Default": "Verbose",
          "System": "Information",
          "Microsoft": "Information"
        }
      }

Upvotes: 2

Views: 378

Answers (1)

devfric
devfric

Reputation: 7542

To get the standard ASP.NET Core template to write log files the only thing that you need to change is the web.config. This is assuming you haven't changed any else different in the default template code.

Change stdoutLogEnabled from false to true

<configuration>
<system.webServer>
<handlers>
  <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform  processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>

Upvotes: 1

Related Questions