Is it possible to log additional HTTP headers in IIS logs?

14,038

Solution 1

In order to log custom headers IIS Advanced Logging must be enabled. A good article on enabling advanced logging and using it to log custom fields can be found at http://www.iis.net/learn/extensions/advanced-logging-module/advanced-logging-for-iis-custom-logging

Solution 2

You can use failed request tracing in IIS to include status code 200. This would log successful requests too and you can view all request headers in the "request details" > "general request headers" section.

Share:
14,038

Related videos on Youtube

Juanjo Daza
Author by

Juanjo Daza

Updated on September 18, 2022

Comments

  • Juanjo Daza
    Juanjo Daza over 1 year

    I need to analyze logs for Exchange and would like to get additional headers saved such as MS-ASProtocolVersion

    Is is possible to configure IIS to log these additional headers?

    POST /[email protected]&DeviceId=ApplDNRJP5Dasdf&DeviceType=iPhone&Cmd=Sync HTTP/1.1
    Host: email.asdf.mobi
    X-MS-PolicyKey: 886721299
    Accept-Language: en-us
    User-Agent: Apple-iPhone5C1/1002.146
    Proxy-Connection: keep-alive
    Accept: */*
    Content-Type: application/vnd.ms-sync.wbxml
    Connection: keep-alive
    Cookie: NSC_Fydibohf_2010_PXB_wtfswfs=ffffffff098a114045525asdfasdf
    Authorization: Basic bWasdfasdfasdfsdfa
    Content-Length: 64
    MS-ASProtocolVersion: 14.1
    Accept-Encoding: gzip, deflate
    
  • Holf
    Holf almost 7 years
    This works brilliantly! It's a lovely solution insofar as you don't have to install anything else on the box.