Advanced Logging and W3C Extended Logging FormatRSS

9 replies

Last post Dec 21, 2020 10:11 AM by samwu

‹ Previous Thread|Next Thread ›
  • Advanced Logging and W3C Extended Logging Format

    Dec 15, 2020 05:36 PM|Lisciolo|LINK

    Hello,

    i've been asked to provide logs for an asmx webservice i wrote some years ago.

    They want to log just the requests to that specific webservice URL. I should not log the requests to pages etc...

    The website is hosted on a Windows Server 2008R2, so i've installed and configured "Advanced Logging", filtering the requests on destination URL. And it works fine.

    But there are some issues about the format.

    It seems I should remove the "milliseconds" from date/time fields, and remove the quotes from the string filelds, replacing the "spaces" with a "+" char.

    (it looks more like the IIS "stardard" logging)

    Edit:  Example:

    This is what i get from Advanced Logging:  

    2020-11-26 14:26:54.861 "mywebsitename" x.x.x.x GET /wsvcs/mywebservice.asmx WSDL 80 - y.y.y.y "HTTP/1.1" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.102 Safari/537.36" [etc etc]

    This is what it should be like:  

    2020-11-26 14:26:54 mywebsitename x.x.x.x GET /wsvcs/mywebservice.asmx WSDL 80 - y.y.y.y HTTP/1.1 Mozilla/5.0+(Windows+NT+10.0;+WOW64) ........ [etc etc]

    Can you please tell me what i'm missing?

    Thank you,

    Andrea

  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 16, 2020 07:31 AM|samwu|LINK

    Hi Lisciolo,

    Lisciolo

    This is what it should be like:  

    2020-11-26 14:26:54 mywebsitename x.x.x.x GET /wsvcs/mywebservice.asmx WSDL 80 - y.y.y.y HTTP/1.1 Mozilla/5.0+(Windows+NT+10.0;+WOW64) ........ [etc etc]

    As far as I know, in iis logging, there are only 3 formats of log files: W3C, IIS, NCSA. 

    But this does not meet your format requirements, or you can try a custom format.

    More information about IIS log file formats you can refer to this link: IIS Log File Formats.

    Best regards,

    Sam

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 16, 2020 09:03 AM|Lisciolo|LINK

    Hello Sam,

    Your snapshot is the logging system integrated in IIS.

    That W3C format will match the format required, but i need to:

    • 1) Filter and log the request to a specific URL only
    • 2) Add the  "x-forwarded-for" field (i could not find it in the "standard" fields)

    That's why i've installed the "AdvancedLogging" module.... I can solve these 2 issues, but then i got a different format (as on my first post)

    Thanks,

    best regards,

    Andrea 

  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 17, 2020 07:09 AM|samwu|LINK

    Hi Lisciolo,

    Lisciolo

    That's why i've installed the "AdvancedLogging" module.... I can solve these 2 issues, but then i got a different format (as on my first post)

    Advanced Logging has expired, only the version before iis8 supports it. I found out by looking up the information that Advanced Logging does not seem to support modifying the log format. I suggest you use logging in iis.

    Lisciolo

    Add the  "x-forwarded-for" field (i could not find it in the "standard" fields)

    In IIS10, you can use X-Forwarded-For header, but you need use add Custom Field.

    In the “Add Custom Field” window, fill out the following fields:

    Field Name: X-Forwarded-For, Source type: Request Header, Source: X-Forwarded-For

    Best regards,

    Sam

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 17, 2020 10:08 AM|Lisciolo|LINK

    Hello Sam,

    thank you for reply.

    At the moment, the website is hosted on a Windows Server 2008 R2, so the IIS version is 7.5

    I think i can manage to obtain an upgrate to an IIS 10 webserver (2008R2 is out of support).

    So, in IIS 10 i can add custom fields to logging, but i don't know how to filter the requests to log... 

    I need to log the  requests to a certain URL only. (i know ho to do it with AdvancedLogging).

    Thanks,

    Best regards,

    Andrea

  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 18, 2020 09:06 AM|samwu|LINK

    Hi Lisciolo,

    Lisciolo

    I need to log the  requests to a certain URL only. (i know ho to do it with AdvancedLogging).

    Can you explain which requests you need to log?

    usually, we can use failed request tracking to get the current request information.

    Best regards,

    Sam

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 18, 2020 09:26 AM|Lisciolo|LINK

    Hello Sam,

    thanks for reply.

    I mean that I should write into that log just the requests to a certain URL.

    The websites has several pages and functionalities. Many users access those pages and perform operations on the apsx pages.

    I should not log those requests. The log file should contain just the requests to "mywebservice,asmx".

    Thanks,

    Andrea

  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 18, 2020 09:37 AM|samwu|LINK

    Hi Lisciolo,

    Lisciolo

    The log file should contain just the requests to "mywebservice,asmx".

    If you want to get the request of the specified url, then you can use Fiddler to view it. In the iis log, it is not possible to directly specify the url.

    Best regards,

    Sam

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 18, 2020 09:47 AM|Lisciolo|LINK

    The log file should be transmitted (on a schedule) to a 3rd party application.

    It's not for "my use"... they want to log the webservice requests only. That's why i've installed the "AdvancedLogging".

    I just wanted to know if there was a way to accomplish it, (a way i didn't know).

    Anyway, i think i will tell them that my log will contain all the requests, and they should filter it at their side.

    Thanks anyway for interesting.

    Best regards,

    Andrea

  • Re: Advanced Logging and W3C Extended Logging Format

    Dec 21, 2020 10:11 AM|samwu|LINK

    Hi Lisciolo,

    I know there are many ways to get the request of the specified url, such as filter and failed request tracing, but only logging the webservice requests seems to be only through Advanced Logging.

    Best regards,

    Sam

    .NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
‹ Previous Thread|Next Thread ›