You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Andrew Purtell (JIRA)" <ji...@apache.org> on 2014/06/02 23:31:03 UTC

[jira] [Updated] (HBASE-11284) Asynchronous logging with Log4j2

     [ https://issues.apache.org/jira/browse/HBASE-11284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-11284:
-----------------------------------

    Attachment: HBASE-11284.patch

Attached is a proof of concept patch that passes all unit tests. 

Change summary:\\

- 53 files changed, 497 insertions, 531 deletions

- POM changes: Import log4j2 artifacts only into the compiler classpath. Include the artifacts that wire log4j2 up to commons-logging and slf4j. Exclude log4j1 except in test scope (required by Hadoop). Bring slf4j into test scope also (required by Hadoop, ZooKeeper, and Thrift). 

- org.apache.log4j.Level is an internal implementation detail of 1.x no longer available. Remove all uses.

- org.apache.log4j.Appender is also an internal implementation detail of 1.x. One unit test and a log management utility requires reimplementation or removal. For now offending code is commented out and marked with TODO

- Replace log4j.properties files with log4j2.xml and log4j2-test.xml files. Not sure if these are functional yet. May require tweaks if significantly deviating from old behavior. conf/hbase-env.sh and bin/hbase required minor related changes. Haven't figured out how to do custom log levels yet like we had in the old log4j.properties files.

> Asynchronous logging with Log4j2
> --------------------------------
>
>                 Key: HBASE-11284
>                 URL: https://issues.apache.org/jira/browse/HBASE-11284
>             Project: HBase
>          Issue Type: Improvement
>            Reporter: Andrew Purtell
>         Attachments: HBASE-11284.patch
>
>
> Log4j 2.0 is the successor project to Log4J 1.x and logback. From http://logging.apache.org/log4j/2.x/:
> {quote}
> Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many of the improvements available in Logback while fixing some inherent problems in Logback's architecture. [...] Log4j 2 contains next-generation Asynchronous Loggers based on the LMAX Disruptor library. *In multi-threaded scenarios Asynchronous Loggers have 10 times higher throughput and orders of magnitude lower latency than Log4j 1.x and Logback*.
> {quote}
> Use Log4j2's asynchronous logger for managing HBase log messages. We can't do anything about Hadoop or ZooKeeper or other components but the preponderance of logging done by HBase during operation comes from our own code.
> Log4j2 can remain hidden behind the commons-logging facade except where we might programmatically adjust configuration and add components (unit tests, log management utilities). 
> Log4j2 can also automatically reload configuration upon modification, will be useful for operations.
> We have already brought the LMAX Disruptor in on trunk for the WAL.



--
This message was sent by Atlassian JIRA
(v6.2#6252)