UserName (cs-username) is always blankRSS

8 replies

Last post Feb 24, 2017 05:40 PM by ivanildogalvao

  • UserName (cs-username) is always blank

    Aug 19, 2010 07:35 AM|resourceY9266|LINK

    I am not able to get the Advanced Logging feature to log any username information. I have tested on a simple site with Basic Authentication and on a MOSS site with Windows Authentication, the cs-username field always shows up as only a hyphen. If I set a default value for the field, it does show up in the logs. In all cases, the username information is logged in the normal logs, just not in the advanced logs.

    Any ideas?

    cs-username

  • Re: UserName (cs-username) is always blank

    Sep 10, 2010 01:57 PM|rdavis|LINK

    I ran into the same issue, cs-username not logged.

  • Re: UserName (cs-username) is always blank

    Oct 03, 2010 09:13 PM|B&R Enclosures|LINK

    Hi, No solutions yet? We are also getting the problem for an ASP.NET web service which ISN'T running in Classic Mode. Interestingly, the cs-username in the "normal" IIS logs is populated correctly (but we want to use the Advanced Logging to filter out unwanted logs). Cheers Peter
  • Re: UserName (cs-username) is always blank

    Oct 04, 2010 02:11 AM|resourceY9266|LINK

    Didn't find a solution, but if anyone does find one I'd be interested to know.
  • Re: UserName (cs-username) is always blank

    Mar 28, 2011 04:08 PM|rblissitt|LINK

    Here is the response we received from Premier:

    I have been able to successfully reproduce the problem with the Advanced Logging module not logging the cs-username field.  As it turns out, Microsoft already has a bug open and it is currently being triaged.  However, in the meantime, there is a relatively painless workaround to get the cs-username field to start logging.

    1)      Open the C:\Windows\System32\inetsrv\config\applicationHost.config file in a text editor.

    2)      Locate the following line in the file:

    <field id="UserName" sourceName="UserName" sourceType="RequestHeader" logHeaderName="cs-username" category="Default" loggingDataType="TypeLPCSTR" />

    3)      Change the sourceType value to “BuiltIn” instead of “RequestHeader”:

    <field id="UserName" sourceName="UserName" sourceType="BuiltIn" logHeaderName="cs-username" category="Default" loggingDataType="TypeLPCSTR" />

    4)      Save the file.

    The appropriate username should now be logged in the Advanced Logging feature logs.  You should not need to restart the IIS services after making this change.

    NOTE: Always backup your IIS configuration files before making any changes.  Directly editing the applicationhost.config file can have undesirable effects if incorrect changes are made, so take care to make only the required changes.

  • Re: UserName (cs-username) is always blank

    Jan 30, 2012 03:22 PM|Shiva.Renganathan|LINK

    Thanks This Worked..I was having the same issue.. 

    Sivasubramaniam
  • Re: UserName (cs-username) is always blank

    Jul 01, 2013 12:03 PM|WinBoze|LINK

    That string is not in the config file at all.  I looked for pieces of it and can't find any of it.

    What other lines precede and succeed it?  I am in IIS7.0.

  • Re: UserName (cs-username) is always blank

    Jun 04, 2014 03:21 PM|Cyberfreak|LINK

    FYI in case anyone comes across this - I had the issue where it wasn't in the config file at all - I just cut and paste the section from another server.

    Also, if anyone makes this change and the username STILL isn't showing up you have to edit the existing log definitions and remove Username, click apply, and then add username back in and click apply. Then username will appear in the logs. It took me a while to figure this one out so hopefully it helps someone.

    cs-username Advancedlogging

  • Re: UserName (cs-username) is always blank

    Feb 24, 2017 05:40 PM|ivanildogalvao|LINK

    I can not find these parameters in IIS from Windows Server 2012, in this case, how do I solve this same problem?

    Thanks !