iis 10 - IIS 10 Logging is not working anymore when custom field is added - Stack Overflow

In IIS10, I'm trying to log in file some custom fields like X-Client-Type etc.So in Logging optio

In IIS10, I'm trying to log in file some custom fields like X-Client-Type etc.

So in Logging options on the WebSite I want to, I'm adding a custom field

name : XCT Source Type : Request header Source Name : X-Client-Type

But When I apply, no more log. If I delete logs are back.

I've tried a lot of thing :

  • Configured Referer or User-Agent as Custom Field => No more log too
  • installed Module to See Failed Request => Header X-Client-Type is in request log error when I generate a 400 but no IIS LOG.
  • Set full permission for all user on log directory
  • Try different Source Name No Space, No tiret, no Underscore, CAPS only but no more log

No error in Windows Events for IIS Logging

I don't know what to try now. I'm out of ideas.

Thanks to anyone who can help me.

[MRE]

  1. create a website api

  2. publish on IIS 10 with a name like yoursite

  3. Enable log W3C on a directory

  4. Call API with a route like GET yoursite/salaries

  5. Check Log on the directory. It contains line for this call

  6. Add Custom Fields in Logging settings, like name : XCT Source Type : Request header Source Name : X-Client-Type

  7. Apply and reset the website

  8. Call API with a route like GET yoursite/salaries with, in headers, X-Client-Type value : WHATEVER

  9. Check the API , no line added.

[/MRE]

In IIS10, I'm trying to log in file some custom fields like X-Client-Type etc.

So in Logging options on the WebSite I want to, I'm adding a custom field

name : XCT Source Type : Request header Source Name : X-Client-Type

But When I apply, no more log. If I delete logs are back.

I've tried a lot of thing :

  • Configured Referer or User-Agent as Custom Field => No more log too
  • installed Module to See Failed Request => Header X-Client-Type is in request log error when I generate a 400 but no IIS LOG.
  • Set full permission for all user on log directory
  • Try different Source Name No Space, No tiret, no Underscore, CAPS only but no more log

No error in Windows Events for IIS Logging

I don't know what to try now. I'm out of ideas.

Thanks to anyone who can help me.

[MRE]

  1. create a website api

  2. publish on IIS 10 with a name like yoursite

  3. Enable log W3C on a directory

  4. Call API with a route like GET yoursite/salaries

  5. Check Log on the directory. It contains line for this call

  6. Add Custom Fields in Logging settings, like name : XCT Source Type : Request header Source Name : X-Client-Type

  7. Apply and reset the website

  8. Call API with a route like GET yoursite/salaries with, in headers, X-Client-Type value : WHATEVER

  9. Check the API , no line added.

[/MRE]

Share Improve this question asked Mar 13 at 9:10 Vincent BoyerVincent Boyer 11 bronze badge 1
  • could you share the screenshot of the iis logging setting with the custom flied you have added – Jalpa Panchal Commented Mar 14 at 3:29
Add a comment  | 

1 Answer 1

Reset to default 0

You could follow below steps to add the custom flied in the iis logs:

  1. Open iis manger
  2. From the middle pane , select configuration editor

  1. In the section select: system.applicationHost/sites
  2. From collection select three dots

  1. Select website for which you would like to add the custom field
  2. From the properties Go to the LogFiles -> CustomFields
  3. Add the field by clicking on three dots

  1. Add your data as shown in the below image-> apply the changes

Visit your site hard refresh and wait for the files to get generated. You can see the new file exist with the _x name in the log folder

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744712154a4589407.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信