在 IIS 7.5 上运行 ASP.NET Core 时,日志会去哪里?

编程入门 行业动态 更新时间:2024-10-23 01:34:11
本文介绍了在 IIS 7.5 上运行 ASP.NET Core 时,日志会去哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在发布并回答它,因为这让我难住了很长时间.我的 web.config 中有以下行:

I'm posting this and answering it, because this left me stumped for a very long time. I have the following line in my web.config:

<aspNetCore processPath="dotnet" arguments=".XXX.Server.dll" stdoutLogEnabled="true" stdoutLogFile=".logsstdout" forwardWindowsAuthToken="false" />

很明显,这应该记录到 logsstdout,但是当我查看时,那里什么也没有.我继续疯狂追逐,在整个磁盘中搜索任何名为log"(返回过多)或stdout"(未返回任何内容)的内容,但仍然无法弄清楚.

So apparently, this should be logging to logsstdout, but when I look, there's nothing there. I went on a wild goose chase, searching the whole disk for anything named 'log' (that returned too much) or 'stdout' (that returned nothing), and still couldn't figure it out.

推荐答案

您可能可以检查您机器上的事件查看器 ->用于查看是否记录了任何错误的应用程序,这可以解释为什么没有生成日志文件.

You could probably check the Event Viewer on your machine -> Application to see if there are any errors logged, which could explain why your log files aren't being generated.

但是,最可能的原因是 IIS 没有写入该日志文件夹的权限.

However, the most probable reason is that IIS doesn't have a permission to write to that log folder.

  • 右键单击文件夹 ->安全
  • 确保 IIS_IUSRS 用户具有以下权限:读取和执行、列出、写入(默认情况下可能缺少写入)
  • Right click on the folder -> Security
  • Ensure that IIS_IUSRS user has the following permissions: read and execute, list, write (potentially write is missing by default)
  • 更多推荐

    在 IIS 7.5 上运行 ASP.NET Core 时,日志会去哪里?

    本文发布于:2023-11-16 16:26:28,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1605932.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:会去   日志   IIS   ASP   Core

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!