How can I install Advanced Logging for IIS?

Anderson França 1 Reputation point
2021-07-14T23:21:31.957+00:00

I am trying to install Advanced Logging for IIS. There are 2 download options (https://learn.microsoft.com/en-us/iis/extensions/advanced-logging-module/advanced-logging-for-iis-custom-logging) but neither one is available anymore. How can I do it?

Internet Information Services
{count} votes

2 answers

Sort by: Most helpful
  1. Sam Wu-MSFT 7,526 Reputation points Microsoft Vendor
    2021-07-16T07:12:27.203+00:00

    Hi @Anderson França

    You can use custom logging to add X-Forwarded-For field in iis Logging, the directory the custom logs are stored in: %SystemDrive%\inetpub\logs\LogFiles.

    1. Open IIS Manager
    2. On server, site or application level, double click "Logging"
    3. Click "Select Fields"
    4. In “W3C Logging Fields” window, click “Add Field“
    5. In the “Add Custom Field” window, fill out the following fields
    6. Field Name: X-Forwarded-For, Source type: Request Header, Source: X-Forwarded-For
    7. Click ”OK" in both open windows
    8. Click “Apply” in the actions pane

    115337-capture.png

    Check out this post for more screenshots.

    Note: If you see a dash (“-“) instead of an IP address in X-Forwarded-For column, it means the client didn’t use any proxies or load balancers. Therefore, the client IP must be logged in the “c-ip” column

    If you see multiple IP addresses in X-Forwarded-For column, it means the client went through more than one network device. Each network device adds their own IP to the end of the value. The left-most IP address is the actual client IP address. Others belong to network devices the client go through.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Anderson França 1 Reputation point
    2021-07-16T12:50:22.403+00:00

    Hello @Sam Wu-MSFT I need it to be Field Name=c-ip and Source=X-Fowarded-For. Advanced Logging would allow me to have it but custom loggin won't, unfortunately. ( https://learn.microsoft.com/en-us/troubleshoot/iis/customize-iis-log-file-field-names ) Thank you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.