【问题标题】:Why don't I get a error logs for 500 Interal Errors in my logs directory in ASP.NET Core为什么我在 ASP.NET Core 的日志目录中没有收到 500 个内部错误的错误日志
【发布时间】:2016-07-02 10:39:24
【问题描述】:

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

两者都能正常工作。

但是,当我想重新启动应用程序时,我触摸了其中一个的 web.config,然后出现以下错误。

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

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

我有 3 个目录 -approot -wwwroot -日志

为什么我得到错误时日志目录是空的

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

我的 appsettings.json

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

【问题讨论】:

    标签: asp.net-core


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-07-11
      • 2011-06-11
      • 2011-12-21
      • 2011-11-01
      • 2013-12-26
      相关资源
      最近更新 更多