How do I increase the maximum size for failed request logs?

£可爱£侵袭症+ 提交于 2020-04-17 22:32:31

问题


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.

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

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.

The default value is 1024.

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):

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.

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):

What am I doing wrong?


回答1:


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.

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.

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

1)open iis manager. select server node

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

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

4)apply the changes and restart the iis server.

you could refer the below link for more detail:

FREB: LOG_FILE_MAX_SIZE_TRUNCATE



来源:https://stackoverflow.com/questions/60863607/how-do-i-increase-the-maximum-size-for-failed-request-logs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!