-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GetEnvironmentUserName is returning the incorrect result for ASP .NET applications because ENV_USER_NAME is not being defined as expected #12
Comments
Sounds like a bug, thanks for the report. |
I may be able to PR this later - I strongly suspect it is just a case of needing to use (It does seem as though the framework names in project.json have fluctuated a lot, which would explain the bug) |
Maybe you could confirm if you accidentally referenced or disassembled the |
Ahh maybe it's supposed to be |
It seems |
Fix published in https://www.nuget.org/packages/Serilog.Enrichers.Environment/2.1.2-dev-00731 - thanks @skomis-mm! |
Is there any chance of seeing this fix go into a stable release any time soon? (Rather than pre-release?) This information is 50% of what this enricher provides, and the use cases affected are quite broad (pretty much anything running as a service or with any kind of sophisticated identity/impersonation will be getting dud results) (- unless you were actively waiting on my feedback for the prelease ver?) |
If it was my feedback you were waiting on, I can now confirm that this fix (2.1.2-dev-00731) definitely works |
@DavidR91 done! Thanks for the nudge. |
(This is against 2.1.1 net452 from NuGet)
When
ENV_USER_NAME
is defined (for the full .NET framework),Environment.UserName
is supposed to be used. This would result in accurate reporting of application pool identities for ASP.NET applications.That is not the case however:
ENV_USER_NAME
doesn't seem to have been defined at build time, and I have confirmed this with DotPeek:This results in inaccurate username information for ASP.NET applications: when the application pools run as a different user, this will consistently report SYSTEM or Network Service (i.e. MACHINENAME$)
I am guessing that perhaps this section of project.json is not being honoured or working as expected?
The text was updated successfully, but these errors were encountered: