Skip to content

Commit

Permalink
Filter out log events with level Off (#191 closes #190)
Browse files Browse the repository at this point in the history
  • Loading branch information
luigiberrettini authored Jul 1, 2019
1 parent b53eb80 commit 608c757
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/NLog.Targets.Syslog/SyslogTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ private void Init(object sender = null, PropertyChangedEventArgs eventArgs = nul
protected override void Write(AsyncLogEventInfo asyncLogEvent)
{
var logEvent = asyncLogEvent.LogEvent;
if (logEvent.Level == LogLevel.Off)
return;
PrecalculateVolatileLayouts(logEvent);
var asyncLoggerId = logEvent.SequenceID % Enforcement.MessageProcessors;
asyncLoggers[asyncLoggerId].Log(asyncLogEvent);
Expand Down

0 comments on commit 608c757

Please sign in to comment.