Hi JC,

Your code looks fine. I usually start with the default log level (ERROR), then 
turn on DEBUG for specific modules, as you do. I then see my INFO or DEBUG 
messages. My code looks like yours, so I'm not sure why you are seeing two 
messages. Perhaps you are logging ERROR level messages?

If you look at the LogFixture code, you'll see that it works by creating a new 
console appender, then enabling only the logging you request. This works if the 
default appender logs only errors and you want to see INFO or DEBUG. I suppose 
it might cause double reporting if you log ERROR messages.

All this leads to a suggestion: if you want to visualize ERROR messages, you 
have two choices. First, don't use the LogFixture since the default logging 
already does what you want. Second, perhaps modify your default file has to 
turn off console logging completely, so that only the LogFixture controls the 
console.

Thanks,
- Paul

 

    On Saturday, November 3, 2018, 12:17:28 PM PDT, Jean-Claude Cote 
<jcc...@gmail.com> wrote:  
 
 I'm using the LogFixture

LogFixtureBuilder logBuilder = LogFixture.builder()
// Log to the console for debugging convenience
.toConsole().logger("org.apache.drill.exec.store.msgpack", Level.DEBUG);
try (LogFixture logs = logBuilder.build()) {


Basice logback.xml file is

<configuration>

<root>
<level value="error" />
</root>

</configuration>


However when I do so I get two outputs. The LogFixtureBuilder seems to
install the appender twice. When I step into the logback code I saw that
the appender was found on "org.apache.drill" and on the ROOT Logger. Which
is why I get two outputs.

I'm using the API correctly?
thanks
jc
  

Reply via email to