IIS:在哪里可以找到 IIS 日志?
我正在尝试设置第三方应用程序,这需要在我的本地 IIS 中托管支持网站。我已经完全按照安装指南中的说明创建了一个网站,但遇到了一些问题,并且想查看 IIS 日志的内容。令人尴尬的是,问题是我找不到日志文件!
所以我的问题是:IIS7默认将日志存储在哪里?
I'm trying to set up an application from a third party, which requires a supporting website hosted in my local IIS. I've created a website exactly as explained in their install guide, but am having some problems, and would like to see what the IIS log has to say. Embarrassingly enough, the problem is I can't find the log files!
So my question is: Where does IIS7 store logs by default?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(11)
我认为访问日志的默认位置是
否则,请在 IIS 管理器下检查,在左侧窗格中选择计算机,然后在中间窗格中转到 IIS 区域中的“日志记录”下。在那里您将设置所有站点的默认位置(但是这在所有站点上都是可覆盖的)
您还可以查看
哪个将包含仅代表错误的类似日志文件。
I think the default place for access logs is
Otherwise, check under IIS Manager, select the computer on the left pane, and in the middle pane, go under "Logging" in the IIS area. There you will se the default location for all sites (this is however overridable on all sites)
You could also look into
Which will contain similar log files that only represents errors.
我相信这是了解 IIS 日志位置的更简单方法,而不仅仅是假设默认位置:
转到您的 IIS 站点,例如“默认”,单击它,如果启用了日志记录,您应该在右侧看到“日志记录” :
< /a>
打开它,你应该看到文件夹就在那里:
不客气!
I believe this is an easier way of knowing where your IIS logs are, rather than just assuming a default location:
Go to your IIS site, e.g. Default, click on it, and you should see "Logging" to the right if logging is enabled:
Open it and you should see the folder right there:
You are welcome!
我添加这个答案是因为在研究了网络之后,我最终得到了这个答案,但仍然不知道要查看 IIS 日志文件夹的哪个子文件夹。
如果您的服务器有多个网站,您需要知道该站点的 IIS ID。在 IIS 中获取此信息的一个简单方法是单击左侧面板中的 Sites 文件夹。每个站点的 ID 显示在右侧面板中。
知道 ID 后,我们将其称为n,相应的日志位于 IIS 日志文件夹的 W3SVCn 子文件夹中。因此,如果您的网站 ID 为 4,并且 IIS 日志位于默认位置,则日志位于此文件夹中:
致谢:
I'm adding this answer because after researching the web, I ended up at this answer but still didn't know which subfolder of the IIS logs folder to look in.
If your server has multiple websites, you will need to know the IIS ID for the site. An easy way to get this in IIS is to simply click on the Sites folder in the left panel. The ID for each site is shown in the right panel.
Once you know the ID, let's call it n, the corresponding logs are in the W3SVCn subfolder of the IIS logs folder. So, if your website ID is 4, say, and the IIS logs are in the default location, then the logs are in this folder:
Acknowlegements:
日志文件默认位置的 100% 正确答案是...
是的,您可以将其输入到资源管理器地址栏中,它会起作用。
为了 100% 确定,您需要查看 IIS 中网站的日志记录。
https ://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/enhanced-logging-for-iis85
即
编辑: 正如 Andy 在下面的评论中指出的,您需要确保在安装 IIS 时选择启用 HTTP 日志记录,否则 HTTP日志记录将不可用。
The 100% correct answer for the default location of the log files is...
Yes you can enter this into the explorer address bar it'll work.
To be 100% sure, you need to look at the logging for the web site in IIS.
https://learn.microsoft.com/en-us/iis/get-started/whats-new-in-iis-85/enhanced-logging-for-iis85
i.e.
EDIT: As pointed out by Andy in the comments below you need to ensure when installing IIS that you elected to enable HTTP logging, otherwise HTTP logging won't be available.
一种更简单的方法是使用 PowerShell,如下所示:
或者只是
如果您只需要自己的信息并且不介意在大脑中解析结果:)。
对于奖励积分,请附加
| ii
到要在资源管理器中打开的第一个命令,或| gci
列出文件夹的内容。A much easier way to do this is using PowerShell, like so:
or simply
if you just need the info for yourself and don't mind parsing the result in your brain :).
For bonus points, append
| ii
to the first command to open in Explorer, or| gci
to list the contents of the folder.尝试查看Windows事件日志,可能会有一些有用的信息
Try the Windows event log, there can be some useful information
启用跟踪可能是 Windows 事件日志的更好替代方案。这为我提供了修复我自己的 WebService 所需的信息。
Enabling Tracing may be a better alternative to the Windows Event Log. This gave me the information I needed to fix my own WebService.
我认为 IIS 日志记录的默认位置是:
c:\inetpub\wwwroot\log\w3svc
I think the Default place for IIS logging is:
c:\inetpub\wwwroot\log\w3svc
我在以下位置找到了 IIS 日志文件。
这有助于解决我的问题。
I have found the IIS Log files at the following location.
which help to fix my issue.
C:\inetpub\logs\LogFiles
检查站点身份及高级设置
C:\inetpub\logs\LogFiles
Check the identity of the site going to sites and advanced settings
最简单的答案是这样查询:
如果您有多个网站,您将得到多个答案,因此您需要使用“foreach”进行查询以获取带有目录的网站名称...
The simplest answer is to query like this:
If you have more than one site you will get more than one answer, so you need to query with a 'foreach' to get the website name with the directory...