zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ZOOKEEPER-2659) Use log4j2 as a logging framework as log4j 1.X is now deprecated
Date Sun, 15 Jan 2017 19:49:26 GMT

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-2659?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15823239#comment-15823239
] 

ASF GitHub Bot commented on ZOOKEEPER-2659:
-------------------------------------------

Github user mikaelstaldal commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/148#discussion_r96145992
  
    --- Diff: src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerMainTest.java ---
    @@ -615,14 +631,18 @@ public void testQuorumDefaults() throws Exception {
             ClientBase.setupTestEnv();
     
             // setup the logger to capture all logs
    +        LoggerContext loggerContext =  (LoggerContext) LogManager.getContext(false);
    +        Configuration logConfig = loggerContext.getConfiguration();
    +        
             Layout layout =
    -                Logger.getRootLogger().getAppender("CONSOLE").getLayout();
    +        		logConfig.getRootLogger().getAppenders().get("STDOUT").getLayout();
    +        String appenderName = "quorumAppender";
             ByteArrayOutputStream os = new ByteArrayOutputStream();
    -        WriterAppender appender = new WriterAppender(layout, os);
    -        appender.setImmediateFlush(true);
    -        appender.setThreshold(Level.INFO);
    -        Logger zlogger = Logger.getLogger("org.apache.zookeeper");
    -        zlogger.addAppender(appender);
    +        WriterAppender appender = WriterAppender.createAppender((StringLayout)layout,
null, new OutputStreamWriter(os), appenderName, false, true);
    --- End diff --
    
    It's probably a good idea to use the builder to create the appender (see above).


> Use log4j2 as a logging framework as log4j 1.X is now deprecated
> ----------------------------------------------------------------
>
>                 Key: ZOOKEEPER-2659
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2659
>             Project: ZooKeeper
>          Issue Type: Wish
>            Reporter: Pushkar Raste
>            Priority: Minor
>         Attachments: zk_log4j2_migration.patch
>
>
> Zookeeper currently uses {{log4j 1.X}} as the default logging framework. {{log4j 1.X}}
is now deprecated http://logging.apache.org/log4j/1.2/
> This ticket is to track efforts to move zookeeper to {{log4j2}}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message