Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
Created October 12, 2014 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelpabich/a767d8b54b43857994ae to your computer and use it in GitHub Desktop.
Save pawelpabich/a767d8b54b43857994ae to your computer and use it in GitHub Desktop.
NLog bug repro
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" autoReload="true">
<targets>
<target name="Console" xsi:type="Console"
layout="${logger} ${level} ${message} ${exception:format=tostring}"
/>
</targets>
<rules>
<logger name="NamespaceToFilterOut.*" minlevel="Debug" final="true" />
<logger name="*" minlevel="Debug" writeTo="Console" />
</rules>
</nlog>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="3.1.0.0" targetFramework="net45" />
</packages>
using NamespaceToFilterOut;
using NLog;
namespace NLogRepro
{
class Program
{
static void Main(string[] args)
{
var class1 = new Class1();
var otherClass = new OtherClass();
}
}
public class OtherClass
{
public OtherClass()
{
var logger = LogManager.GetLogger(this.GetType().FullName);
logger.Debug("Do not filter out Debug");
logger.Info("Do not filter out Info");
}
}
}
namespace NamespaceToFilterOut
{
class Class1
{
public Class1()
{
var logger = LogManager.GetLogger(this.GetType().FullName);
logger.Debug("Filter Debug");
logger.Info("Do not filter out Info");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment