apache log4j 2.1 发布,提供了很多心功能

文章标签: log4j 2.1
2014-10-26 12:38:43     134 人阅读    

  apache log4j 是目前java开发应用最多的日志处理框架,在昨天 apache log4j 团队高兴的宣布,log4j 2.1 版本终于发布了.

  该版本相对于Log4j1.x  性能上有显著的改善

   apache log4j  2.1 必须要在java 6 和以上版本才能运行,兼容上一个版本.


  这是第四个GA版本,包含了若干的bug修改和新功能,此版本有两个新的 Maven artifacts: log4j-jul 和 log4j-iostreams。两个组件都是基于 API 可选 Core 特性。

  新版本下载地址如下:
  http://logging.apache.org/log4j/2.x/download.html

log4j 官方地址
 http://logging.apache.org/log4j/2.x/guidelines.html

使用方法:把如下2个jar报加入到class路径即可
   log4j-api-2.1.jar

   log4j-core-2.1.jar

 个人能力有限,恕不全部翻译...

 

 

 

 

 详细的改变如下:

新功能:
ØLOG4J2-868:添加ShutdownCallbackRegistry接口处理关闭回掉事件。
这是特别
ØLOG4J2-589:配置支持过滤自定义日志级别。
ØLOG4J2-856:文件更新:添加了一部分关于 关于JUL Adapter, IO Streams 和 NoSQL Appenders的章节
ØLOG4J2-848:添加了一个java程序在运行时调用查看的版本信息接口。

ØLOG4J2-809:把 utility class 私有化。
o LOG4J2-833:  Documentation: added Runtime Dependencies link to left nav-bar on site.
o LOG4J2-816:  Documentation: added section on XInclude to user manual Configuration page.

o LOG4J2-547:  Add the Log4j IOStreams component.
o LOG4J2-431:  Added Memory-Mapped File Appender. Thanks to Claude Mamo.
o LOG4J2-827:  Support use of TypeConverter classes through the standard Plugin system.
o LOG4J2-825:  Add simple validation constraint annotations for the Plugin system.
o LOG4J2-428:  Implement a GELF layout. Thanks to Mark Paluch.
o LOG4J2-608:  Add java.util.logging implementation based on log4j-api. See log4j-jul documentation
for more details.
o LOG4J2-793:  Add support for custom SLF4J Markers in log4j-slf4j-impl module.
o LOG4J2-771:  Add lookup for application main arguments.
o LOG4J2-787:  Add lookup for JVM arguments.

Fixed Bugs:
o LOG4J2-676:  Some typo fixes and enhancements for the site. Thanks to Stefan Bodewig.
o LOG4J2-866:  Documentation: fixed missing closing parenthesis in code example. Thanks to
Gerard Weatherby.
o LOG4J2-862:  Fixed classloader issue that prevented Log4j from finding the implementation
when used in a custom Ant task. Thanks to Michael Sutherland.
o LOG4J2-861:  Documentation: fix broken links on left navigation Extending Log4j Configuration
sub-menu.
o LOG4J2-797:  Documentation: clarified why log4j-core is a compile time dependency in Maven
and Ivy page. Thanks to Andreas Rytina.
o LOG4J2-855:  Documentation: fix broken links on Appenders manual page.
o LOG4J2-807:  Prevent NPE when configuration with AsyncLogger/AsyncRoot is reloaded.
o LOG4J2-678:  Documentation: fixed minor issues with Log4j2 web site/documentation. Thanks
to Matt Sicker.
o LOG4J2-843:  Migrate JpaHyperSqlAppenderTest JUnit performance test to log4j-perf.
o LOG4J2-842:  Migrate JpaH2AppenderTest JUnit performance test to log4j-perf.
o LOG4J2-841:  Migrate JdbcHyperSqlAppenderTest JUnit performance test to log4j-perf.
o LOG4J2-840:  Migrate JdbcH2AppenderTest JUnit performance test to log4j-perf.
o LOG4J2-830:  Respect external interrupt signal to allow application shutdown after joining
AsyncAppender thread.
o LOG4J2-813:  MarkerManager Log4jMarker.hasParents() returns opposite of correct result.
Thanks to David Erichsen, Brandon Barry.
o LOG4J2-785:  Documentation: fixed capitalization inconsistency in user manual example config.

o LOG4J2-829:  Fixed issue in RollingFile filePattern: backslashes are path separators, not
escape characters.
o LOG4J2-832:  ThrowableProxy fails if a class in logged stack trace throws java.lang.Error
from initializer Thanks to Seth Leger.
o LOG4J2-745:  Avoid ConverterKey plugin clashes by using a more predictable plugin loading
infrastructure.
       Plugins have been segmented into three parts: class path, user-specified packages,
and OSGi bundles. Thanks to Scott Harrington.
o LOG4J2-798:  Fixed plugin scanning redundancy causing massive slowdowns in certain environments.
Thanks to Scott Harrington.
o LOG4J2-753:  Reduced CachedClock thread contention.
o LOG4J2-819:  Fixed memory leak in Tomcat 6 caused by clock background threads unintentionally
       started by Tomcat after web application stop. Thanks to Gary Gregory.
o LOG4J2-391:  FlumePersistentManager now handles LockConflictExceptions in Berkeley Db when
sending a batch. Thanks to Kamal Bahadur.
o LOG4J2-782:  Remove invalid Oracle Maven repository.
o LOG4J2-796:  Fixed issue where log4j-to-slf4j did not work correctly with SLF4J Simple Logger.

o LOG4J2-811:  SimpleLogger throws ArrayIndexOutOfBoundsException for an empty array. Thanks
to Yogesh Rao.
o LOG4J2-663:  Fix OSGi Import-Package problem with the JMS API. Thanks to Florian Brunner.

o LOG4J2-783:  PatternLayout should use platform character encoding by default, not UTF-8.
Thanks to Minglei Lee.

Changes:
o LOG4J2-845:  Add 2.1.0 to compatible versions in Log4j API ProviderUtil and update Log4jAPIVersion
to 2.1.0 in
       core META-INF/log4j-provider.properties.
o LOG4J2-844:  Update JMH to 1.1 from 0.7.2.
o LOG4J2-831:  Documentation: updated FAQ "which jars" diagrams for JUL bridge and 2.1 version.

o LOG4J2-780:  Update Spring Framework to 3.2.11.RELEASE from 3.2.8.RELEASE.
o LOG4J2-815:  Unify the two JMS appenders into a single appender. Configurations written
for 2.0 will still work in 2.1+.
o LOG4J2-790:  Update Jackson to 2.4.2 from 2.4.1 (for XML and JSON processing).
o LOG4J2-766:  Incomplete documentation for JSONLayout. Thanks to Bruno P. Kinoshita.
o LOG4J2-800:  All life cycle implementations should be serializable.
       This is still work in progress.
o LOG4J2-801:  org.apache.logging.log4j.core.Logger should be serializable.
       This is still work in progress.
o LOG4J2-810:  Update javax.mail to 1.5.2 from 1.5.0.
o LOG4J2-822:  Update org.eclipse.persistence.jpa to 2.5.2 from 2.5.1.
o LOG4J2-867:  FlumeAppender: maxDelay not in seconds, but milliseconds.
       Add time scale to some settings, for example maxDelayMillis instead of maxDelay.
       The old names are aliased for compatibility.

Apache的Log4j的2.1至少需要Java 6中的建立和运行。与基本的兼容性
Log4j的1.x中通过的log4j-1.2-API组件提供的,但它没有实现部分

非常实施特定的类和方法。该软件包的名称和Maven的groupId有
被改变为
org.apache.logging.log4j避免与log4j的1.x的任何冲突

对于在Apache的Log4j2的完整信息,包括如何提交错误报告的说明,
补丁或改进建议,请参见Apache Apache的Log4j的2网址:

http://logging.apache.org/log4j/2.x/<http://logging.apache.org/log4j/2.x/>


原文地址:http://www.itmmd.com/201410/60.html
该文章由 萌萌的IT人 整理发布,转载须标明出处。

Spring Sync ,基于Spring服务器之间的数据交换....   上一篇
下一篇  IT人!打破新的自由落体运行

精彩回复
#1楼    ; [评论人]:log4j   [发表时间]:2014-12-16 17:47:47

介绍的很详细了,站长很用心....谢谢分享,比别的地方翻译的好多了

发表评论
姓名:       

《程序员app》专门为程序员量身定做!