-
Notifications
You must be signed in to change notification settings - Fork 165
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
UseNLog allow fallback to only EnvironmentName for NLog config #1066
Conversation
27be075
to
582b2b8
Compare
@RWells-HUHS Please try testing with the pre-release nuget-package found here: Then I believe the NLog InternalLogger will give better output on NET9, so we figure out what causes NET9 to produce strange file-paths that leads to Just download the nuget-package Then run your application after having made sure to enable NLog InternalLogger from code. at LogLevel.Debug. |
Side note: I had to rename the downloaded file from |
Congratulations! 5.3.14.1175-PR1066 doesn't exhibit the same error. :-) The (failed) attempts to use the UNC are the same as under .12, but, as in the working .11, execution proceeds from there to use the mapped drive:
Fundamentally, whatever NLog is trying to do to get the UNC hostname out of the mapped drive isn't working, even in .11 and .14.1175-PR1066. But in .12 and .14 (I didn't actually test .13), some step between the statements that writes the two lines above throws that unhandled FWIW, the execution environment is in an unprivileged user session on Windows Server 2022. The drive mapping is memorized under my unprivileged user, to a restricted share on another Windows Server 2022 system. |
@RWells-HUHS Thank you for the very fast confirmation. Will see if I can make the build-engines produce a new official release for nuget. |
Quality Gate failedFailed conditions |
@RWells-HUHS Have now released NLog.Web.AspNetCore v5.3.15, so you should not be blocked. But could be interesting if |
As mentioned in our related chat on SO, Separately, 5.3.15 is generally working for me, though I do get this build warning:
I don't recall getting this with earlier 5.3.* versions. |
You should remove the project-dependency on NLog.Web and only have dependency on NLog.Web.AspNetCore when using NET9 |
Ah! Thanks. Didn't realize the two packages were mutually exclusive. (Migrating older .NET Framework codebase that used NLog.Web, so I had simply added NLog.Web.AspNetCore.) |
Use
LoadConfigurationFromFile
instead of explicit creatingXmlLoggingConfiguration
for better NLog InternalLogger output.