Henry Robinson commented on ZOOKEEPER-654:

It seems like the code is retrieving a Layout object for log4j which it uses to 
format output to a custom appender. Is there a way of programmatically creating 
a Layout that will do the same thing? 

Something like this:

Layout layout = new SimpleLayout();

passes tests for me.

It depends, is the idea that we test that something is logged under the default 
log4j layout? Or that it gets logged at all (and using any layout that prints 
out messages will do)?

> Tests should not rely on CONSOLE appender being present
> -------------------------------------------------------
>                 Key: ZOOKEEPER-654
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-654
>             Project: Zookeeper
>          Issue Type: Bug
>    Affects Versions: 3.2.1
>            Reporter: Henry Robinson
>            Priority: Minor
> Tests have been failing for us in an environment where we removed the CONSOLE 
> appender from log4j. This breaks a couple of tests in QuorumPeerMainTest at 
> least.
> I have fixed in our builds by replacing CONSOLE with ROLLINGFILE (which we 
> are using) for the time being, but messing with the log config shouldn't 
> break tests. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to