Recently we worked on an issue where if we set “Both log file and ETW event” for Log Event Destination in the IIS logging, we would see the below error in the event logs for each and every request:
Log Name: Application
Source: Microsoft-Windows-IIS-W3SVC-WP
Date: 11/1/2021 12:46:39 AM
Event ID: 2308
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: xxxx
Description:
The loghttp module in the worker process with id 'xxxx' could not obtain custom log data for '1' requests. The data field contains the error code.
Event Xml:
<Event xmlns=http://schemas.microsoft.com/win/2004/08/events/event>
<System>
<Provider Name="Microsoft-Windows-IIS-W3SVC-WP" Guid="{670080D9-742A-4187-8D16-41143D1290BD}" EventSourceName="W3SVC-WP" />
<EventID Qualifiers="49152">2308</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2021-11-01T07:46:39.9624364Z" />
<EventRecordID>112953</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>xxxx</Computer>
<Security />
</System>
<EventData>
<Data Name="RequestCount">1</Data>
<Data Name="PID">xxxx</Data>
<Binary>
</Binary>
</EventData>
</Event>
Steps to replicate this problem:
Event 2308 from IIS-W3SVC-WP will be created for each request:
The loghttp module in the worker process with id '93692' could not obtain custom log data for '1' requests. The data field contains the error code.
Cause:
This issue has been identified as a bug in Windows Server 2019 and newer releases. Please note that this only occurs with the 32 bit applications when ETW logging is enabled.
Possible workarounds:
Here is an example snippet in applicationHost.config:
<site name="Test" id="2" serverAutoStart="true">
<application path="/" applicationPool="Test">
<virtualDirectory path="/" physicalPath="C:\inetpub\wwwroot" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:8080:" />
</bindings>
<logFile logTargetW3C="File, ETW">
<customFields>
<clear />
<add logFieldName="Method" sourceName="HTTP_METHOD" sourceType="ServerVariable" />
</customFields>
</logFile>
</site>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.