为什么我在ASP.NET Core的日志目录中没有收到500个Interal Errors的错误日志

时间:2016-07-02 10:39:25

标签: asp.net-core

我基于默认的asp.net核心模板部署了ASP.NET Core RC1 web application

两者都正常工作。

但是我触摸了一个web.config,因为我想重新启动应用程序,然后我收到以下错误。

  

:(哎呀。   500内部服务器错误   启动应用程序时发生错误。

如何解决无法启动应用程序的原因?我用原始的web.config重新获得了它,但是当我访问站点URL时仍然出现错误。

我有3个目录 -approot -wwwroot -logs

当我收到错误时,为什么日志目录为空

我正在使用asp.net模板中的默认日志记录

我的appsettings.json

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

1 个答案:

答案 0 :(得分:1)

要使标准ASP.NET Core模板写入日志文件,您需要更改的唯一内容是web.config。这假设您没有更改默认模板代码中的其他任何其他内容。

stdoutLogEnabledfalse更改为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>