datalust / nlog-targets-seq

An NLog target that writes events to Seq. Built for NLog 4.5+.
https://getseq.net
Apache License 2.0
21 stars 11 forks source link

React to "MinimumLevelAccepted" response from Seq, when POSTing events from NLog.Targets.Seq #49

Closed larenelg closed 4 years ago

larenelg commented 4 years ago

Similar to Serilog.Sinks.Seq, add a feature so NLog may also only send logs that are the minimum level and above, as per response body from the Seq server with each batch of events sent.

NameOfTheDragon commented 4 years ago

Uncanny! I was just looking at the source to see how tricky this would be. I may have a go (don't hold your breath though!)

larenelg commented 4 years ago

Hi Tim! Oh that's great, I just responded to your post on the Seq discussion board. Hope that the example provided is helpful. Let us know if you have any questions, will do our best to help.

NameOfTheDragon commented 4 years ago

It turns out that you probably could have held your breath ;-) I think I have it working. I'll do a bit more testing and submit a PR. --.T

1 2020-07-21 14:33:17.1748 Info Auto loading assembly file: D:\VS-Projects\TA.NexDome.AscomServer\BuildOutput\Debug\NLog.Targets.Seq.dll   
2 2020-07-21 14:33:17.4818 Info Loading assembly file: D:\VS-Projects\TA.NexDome.AscomServer\BuildOutput\Debug\NLog.Targets.Seq.dll   
3 2020-07-21 14:33:17.9578 Info NLog.Targets.Seq, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aec39280ded1b3a7. File version: 1.2.1.0. Product version: 1.2.1. GlobalAssemblyCache: False   
4 2020-07-21 14:33:17.9848 Info Auto loading assembly file: D:\VS-Projects\TA.NexDome.AscomServer\BuildOutput\Debug\NLog.Targets.Seq.dll succeeded!   
5 2020-07-21 14:33:18.0928 Info Message Template Auto Format enabled   
6 2020-07-21 14:33:18.1788 Info Adding target AsyncTargetWrapper(Name=DebugView)   
7 2020-07-21 14:33:18.2288 Info Adding target AsyncTargetWrapper(Name=LogFile)   
8 2020-07-21 14:33:18.3158 Info Adding target AsyncTargetWrapper(Name=seq)   
9 2020-07-21 14:33:18.3768 Info Validating config: TargetNames=DebugView, LogFile, seq, ConfigItems=94, FilePath=D:\VS-Projects\TA.NexDome.AscomServer\BuildOutput\Debug\NLog.config   
10 2020-07-21 14:33:18.4548 Info Configuration initialized.   
11 2020-07-21 14:33:18.4748 Info NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c. File version: 4.7.2.11786. Product version: 4.7.2+024896f64b840a743d3fd89e29c2186681e7795f. GlobalAssemblyCache: False   
12 2020-07-21 14:33:41.5503 Info Seq(Name=seq): Setting minimum log level to Info per server request
NameOfTheDragon commented 4 years ago

pr#50 ready for review :)