Changing the maxLogFileSizeKB on an Azure App Service


I wrote this article “Making changes to the applicationHost.config on Azure App Service” here which explains the details about creating an XDT file that supports the configuration of some properties found in the applicationHost.config file.  Keep in mind that not all of the attributes in the applicationHost.config file can be altered, you might be able to get them to show, but it does not mean that DWAS will honor them.

If you have enabled Failed Request Tracing which I have discussed here and here, and you are reaching the LOG_FILE_MAX_SIZE_TRUNCATE threshold, then you will need to increase the maxLogFileSizeKB value to a size greater than the default of 1024.  Your XDT file should look something similar to the following:

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.applicationHost>
    <sites>
      <site name="%XDT_SITENAME%" xdt:Locator="Match(name)">
        <traceFailedRequestsLogging xdt:Transform="Remove" />
        <traceFailedRequestsLogging xdt:Transform="Insert" enabled="true" customActionsEnabled="true" directory="D:\home\LogFiles" maxLogFileSizeKB="51200" maxLogFiles="200" />
      </site>
    </sites>
  </system.applicationHost>
</configuration>

You can find your App Service applicationHost.config file by following these instructions.

In IIS you could change this from the IIS Manager, as seen in Figure 1.

image

Figure 1, changing maxLogFileSizeKB on an Azure App Service

Comments (0)

Skip to main content