ExceptionlessTarget - ProcessQueueAsync for ExceptionlessClient on Flush#301
ExceptionlessTarget - ProcessQueueAsync for ExceptionlessClient on Flush#301niemyjski merged 2 commits intoexceptionless:mainfrom
Conversation
|
@niemyjski I can see that #241 changed the default LogLevel from Trace to Warn. Would it make sense that NLog LoggingRule controlled what LogLevel should produce output? (See that Serilog-Sink has similar issues with the new default value) Example of using <?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets async="true">
<target type="Exceptionless, Exceptionless.NLog" name="exceptionless" apiKey="API_KEY_HERE">
<field name="host" layout="${machinename}" />
<field name="process" layout="${processname}" />
<field name="user" layout="${environment-user}" />
</target>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="exceptionless" />
</rules>
</nlog>Could also consider adding a new |
| } | ||
|
|
||
| protected override void FlushAsync(AsyncContinuation asyncContinuation) { | ||
| _client.ProcessQueueAsync().ContinueWith(t => asyncContinuation(t.Exception)); |
There was a problem hiding this comment.
Is FlushAsync (https://nlog-project.org/documentation/v4.4.0/html/M_NLog_Targets_Target_FlushAsync.htm) called during shutdown or periodically during buffering? If it's while it's buffering, then we probably should remove this as that's already taken care of.
There was a problem hiding this comment.
NLog only calls Flush on process-exit, or if the user explict calls NLog.LogManager.Flush() or NLog.LogManager.Shutdown()
niemyjski
left a comment
There was a problem hiding this comment.
Thanks for the PR! Looks great and I'll merge it, left one question.
|
@snakefoot yeah, I was considering that the logging targets could just set the default min log level on the client (which is only used until server settings were retrieved and last call to that method wins. |
|
Sounds like a sensible way of handling minimum-loglevel, that you perform a "handshake" on first logevent, instead of always using LogLevel.Warn as default. Much more user-friendly. |
Better user-experience when using NLog, and NLog InternalLogger is the recommended place to look when troubleshooting.