如何增加失败请求日志的最大大小? [英] How do I increase the maximum size for failed request logs?

查看:103
本文介绍了如何增加失败请求日志的最大大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在IIS中使用失败的请求跟踪组件.它写入的日志之一以LOG_FILE_MAX_SIZE_TRUNCATE错误结束.

I am using the Failed Request Tracing component in IIS. One of the logs it has written ends with a LOG_FILE_MAX_SIZE_TRUNCATE error.

根据文档 >,这由maxLogFileSizeKB设置控制:

According to the documentation, this is controlled by the maxLogFileSizeKB settings:

如果失败的请求跟踪日志超过此值,则IIS将以最大文件大小截断日志,并为跟踪事件指定LOG_FILE_MAX_SIZE_TRUNCATE.

If failed request tracing logs exceed this value, IIS will truncate the logs at the maximum file size and specify LOG_FILE_MAX_SIZE_TRUNCATE for the trace event.

默认值为1024.

显然,我应该能够通过单击 Site 节点,然后打开网站默认对话框来配置该值.但是,似乎没有最大日志大小设置(德语屏幕截图,但是在其他本地化的IIS版本中应该与此类似):

Apparently, I am supposed to be able to configure that value by clicking the Sites node, and then opening the website default dialog box. However, that maximum log size setting doesn't seem to be in there (German screenshot, but it should be analogous in other localized versions of IIS):

文档还说明了如何直接在Web.config中更改设置,但是我的Web.config文件中只有一个<traceFailedRequests>元素,而不是所示的<traceFailedRequestsLogging>元素.

The docs also explain how to change the setting directly in Web.config, but instead of the depicted <traceFailedRequestsLogging> element, I only have a <traceFailedRequests> element in my Web.config files.

奇怪的是,我什至在整个磁盘上都找不到任何包含为模块配置的常规设置(例如,日志文件的目标路径)的Web.config文件:

Curiously, I cannot even find any Web.config file on my entire disk that contains the general settings configured for the module (e.g. the target path for the log files):

我在做什么错了?

推荐答案

错误消息背后的实际原因是FREB日志太大.默认情况下,IIS将512KB的FREB日志文件截断.对于FREB日志,根本没有太多数据需要完成日志文件.

The actual reason behind the error message was the FREB logs were too big. By default, IIS truncates the FREB log files at 512KB. for the FREB logs there was simply too much data for the log files to complete.

要解决此问题,您可以运行以下命令,以便在下次触发HTTP错误时,您将收到完整的FREB日志文件,并指出了确切的问题:

To resolve the issue you could run the following commands so the next time an HTTP error was triggered you will receive the full FREB log file and it pinpointed the exact problem:

  cd /d "%windir%\system32\inetsrv"
appcmd set config /section:sites -siteDefaults.traceFailedRequestsLogging.maxLogFileSizeKB:1024

注意:不要忘记以管理员身份运行命令提示符.

note: do not forget to run the command prompt as administrator.

您还可以使用iis Manager GUI进行以下更改:

you could also make these changes by using the iis Manager GUI:

1)打开iis管理器.选择服务器节点

1)open iis manager. select server node

2)双击中间窗格中的配置编辑器.

2)double click on the configuration editor from the middle pane.

3)在配置编辑器中,选择"system.applicationHost/sites"部分.设置maxLogFileSizeKB的值.

3)in configuration editor select section "system.applicationHost/sites".set the value for maxLogFileSizeKB.

4)应用更改并重新启动iis服务器.

4)apply the changes and restart the iis server.

您可以参考下面的链接以获取更多详细信息:

you could refer the below link for more detail:

FREB:LOG_FILE_MAX_SIZE_TRUNCATE

这篇关于如何增加失败请求日志的最大大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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