发布于 2015-10-14 00:48:30 | 236 次阅读 | 评论: 0 | 来源: 网友投递
Apache Log4j log记录软件
Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台、文件、GUI组件,甚至是套接口服务器、NT的事件记录器、UNIX Syslog守护进程等;我们也可以控制每一条日志的输出格式;通过定义每一条日志信息的级别,我们能够更加细致地控制日志的生成过程。最令人感兴趣的就是,这些可以通过一个配置文件来灵活地进行配置,而不需要修改应用的代码。
Apache Log4j 2.4.1 发布,更新内容如下:
新特性: o LOG4J2-1129: Allow PatternLayout to select a pattern to use based on some selection criteria. o LOG4J2-1145: Add %equals to PatternLayout to test and replace patterns with strings. o LOG4J2-1147: Add %equalsIgnoreCase to PatternLayout to test and replace patterns with strings. o LOG4J2-1146: Add %notEmpty to PatternLayout to avoid output of patterns where all variables are empty. o LOG4J2-1020: Add possibility to set shutdown timeout on AsyncAppender. 修复Bugs: o LOG4J2-1153: Fixed NullPointerException when only root logger is defined (and no named loggers) in configuration properties file. o LOG4J2-1140: Fixed bug where headers were not being written to first file with RollingFileAppender. o LOG4J2-1149: Fixed bug where PatternLayout predefined date pattern with time zone always renders default date format. o LOG4J2-1050: Fixed Log4jLookup. o LOG4J2-1142: Fix potential memory leak in web applications by using a straight ThreadLocal field instead of subclassing ThreadLocal. o LOG4J2-1135: Compression on rollover was broken: log file was renamed to .zip but not compressed. o LOG4J2-1127: log4j2.xml cannot be parsed on Oracle Weblogic 12c. o LOG4J2-1132: Do not use MongoDB driver 2.13.3 deprecated methods. o LOG4J2-1144: Add %markerSimpleName in pattern layout should evaluate to marker name (not toString()). o LOG4J2-1126: Web site corrections and updates. 变化: o LOG4J2-1151: Performance improvement: backport Java 8 fast ISO-8859-1 String to byte[] encoder to AbstractStringLayout. o LOG4J2-935: Performance improvement when converting Strings to byte[] arrays. o LOG4J2-1040: Update MongoDB driver from 2.13.3 to 3.0.4. o LOG4J2-1128: Reuse StringBuilder to improve performance for String-based layouts: CSV, GELF, HTML, RFC524, Syslog. o LOG4J2-1131: Update mongo-java-driver from 2.13.2 to 2.13.3. o LOG4J2-1138: Do not use Jackson deprecated methods. o LOG4J2-1139: Update Jackson from 2.6.1 to 2.6.2. o LOG4J2-1150: Update kafka-clients from 0.8.2.1 to 0.8.2.2.
更多改进内容请看发行说明。
Log4j是Apache的一个开放源代码项目,通过使用Log4j,我们可以控制日志信息输送的目的地是控制台、文件、GUI组件、甚至是套接口 服务 器、NT的事件记录器、UNIX Syslog守护进程等;我们也可以控制每一条日志的输出格式;通过定义每一条日志信息的级别,我们能够更加细致地控制日志的生成过程。最令人感兴趣的就 是,这些可以通过一个配置文件来灵活地进行配置,而不需要修改应用的代码。