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]
create a website api
publish on IIS 10 with a name like yoursite
Enable log W3C on a directory
Call API with a route like GET yoursite/salaries
Check Log on the directory. It contains line for this call
Add Custom Fields in Logging settings, like name : XCT Source Type : Request header Source Name : X-Client-Type
Apply and reset the website
Call API with a route like GET yoursite/salaries with, in headers, X-Client-Type value : WHATEVER
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]
create a website api
publish on IIS 10 with a name like yoursite
Enable log W3C on a directory
Call API with a route like GET yoursite/salaries
Check Log on the directory. It contains line for this call
Add Custom Fields in Logging settings, like name : XCT Source Type : Request header Source Name : X-Client-Type
Apply and reset the website
Call API with a route like GET yoursite/salaries with, in headers, X-Client-Type value : WHATEVER
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
1 Answer
Reset to default 0You could follow below steps to add the custom flied in the iis logs:
- Open iis manger
- From the middle pane , select configuration editor
- In the section select: system.applicationHost/sites
- From collection select three dots
- Select website for which you would like to add the custom field
- From the properties Go to the LogFiles -> CustomFields
- Add the field by clicking on three dots
- 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条)