在 IIS 7.5 上运行 ASP.NET Core 时,日志会去哪里? [英] Where do logs go when running ASP.NET Core on IIS 7.5?

查看:31
本文介绍了在 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.

  1. 右键单击文件夹 ->安全
  2. 确保 IIS_IUSRS 用户具有以下权限:读取和执行、列出、写入(默认情况下可能缺少写入)
  1. Right click on the folder -> Security
  2. 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 时,日志会去哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆