Created
October 12, 2014 13:35
-
-
Save pawelpabich/a767d8b54b43857994ae to your computer and use it in GitHub Desktop.
NLog bug repro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="NLog" version="3.1.0.0" targetFramework="net45" /> | |
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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