Open snakefoot opened 5 years ago
@sbohlen Added the project to Common.Logging.2010.sln
and cloned from NLog444 (No Visual Studio upgrade)
nice @snakefoot !
@sbohlen Tried upgrading to VS2017-Solution together with new VS2017-csproj-format (Support NetCore)
Please please please, will this make
var clientId = 100; Logger.InfoFormat("A test with client id {ClientId}", clientId.ToString());
display
A test with client id 100
instead of
A test with client id {0}
?!
Yes it will. But because you have done ClientId.ToString then NLog will put quotes around "100"
Great!
Only did the ToString() because I thought I was preventing boxing, but yeah.. I see the quotes now. May I ask for your timeline to publish the new version?
Cheers
I can attach a nuget package for the build. That you can upload to your own nuget-server or put in local-package-folder
Not sure when this PR will be consumed and published by the official project. Not the owner of this project.
Please, that will help me sort this before my stackify retrace trial ends 🥇 .
Ps, I never saw attachments in GitHub, so, where will this attachment appear?
@Mies75 Not able to work on spare-time-projects 24/7. But I have now updated original post with an attachment to a custom build of Common.Logging.NLog45
(Not strong-named)
Awesome effort, trying it now!
bump @sbohlen
any news @Mies75 ?
Must have replied on Stack Overflow instead of GitHub, sorry for that. It works flawlessy, good job!
@sbohlen please merge and release this, thanks!
@sbohlen, do you have time to do the merge and publish it? Then we can remove the custom Common.Logging.NLog45 from our own NuGet repository!
Updated the PR to include better support for callsite-handling. Thanks to @Defee
I am running some perfview tests on our servers, to clear up the exception stack.
Now I run into this: nlog.messagetemplates.templaterenderer,render -> indexoutofrangeexception On a: logger.InfoFormat("End job {QuartzJobName}/{QuartzJobInstance}: ran for {QuartzJobRuntime}ms", context.JobDetail.Key.Name, context.FireInstanceId, context.JobRunTime.Milliseconds)
Is this related to this PR?
Are you running the latest build that I have just updated the initial post (ver 3.4.2) ?
It's our PRD system, running your initial custom build. Is your new PR production worthy in your eyes? Or are you planning on some additional coding?
Update: Pushed the nwe version to our repo, going to run some tests.
Update 2: Tests ran successful, but mind you: wasn't able to reproduce the problem on my dev box.
What version of NLog? Remember never to use throwExceptions=true in production.
The InfoFormat call looks valid. So not sure if you have found the one that actually failed.
NLog 4.5.11 for the affected system.
I am 100% sure that is the line that was failing, and I cannot fathom why. Also tried to make those arguments NULL, didn't fail..
We never user throwExceptions in the nlog.config. When we are experiencing problems we use internal logging.
That version of NLog should work just fine. If you are able to reproduce the case then please let me know.
Any time frame when this will be merged?
Very important and useful changes, is there any news?
And MDLC / NDLC
Attached custom build of nuget-package
Common.Logging.NLog45
(Just remove.zip
file extension):Updated build -> Common.Logging.NLog45.3.4.2.nupkg.zip
It is not built with strong-name. This requires an official build with the "secret" snk-file. But for NetCore / NetStandard then strong-name not required.
You can use it like this in
app.config
:Or use it like this in NetCore
appsettings.json
together with binding-logic (AndNLog.config
):Or just do it from code alone without any config-file:
Previous Build without proper callsite support -> Common.Logging.NLog45.3.4.1.nupkg.zip