Apache Logging Services

Thursday August 31, 2017

Log4j 2.9 released

The Apache Log4j 2 team is pleased to announce the Log4j 2.9 release!

Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides many other modern features such as support for Markers, lambda expressions for lazy logging, property substitution using Lookups, multiple patterns on a PatternLayout and asynchronous Loggers. Another notable Log4j 2 feature is the ability to be "garbage-free" (avoid allocating temporary objects) while logging. In addition, Log4j 2 will not lose events while reconfiguring.

This release contains the first support of Java 9 as well as bugfixes and minor enhancements. The Log4j API was modified to use java.util.ServiceLoader to locate Log4j implementations, although the former binding mechanism is still supported. The Log4j jar is now a multi-release jar to provide implementations of the Java 9 specific classes. Multi-release jars are not supported by the OSGi specification so OSGi modules will not be able to take advantage of these implementations but will not lose functionality as they will fall back to the implementations used in Java 7 and 8. More details on the new features and fixes are itemized below.

Note that subsequent to the 2.9 release, for security reasons, SerializedLayout is deprecated and no longer used as default in the Socket and JMS appenders. SerializedLayout can still be used as before, but has to be specified explicitly. To retain old behaviour, you have to change configuration like:

<Appenders>
  <Socket name="socket" host="localhost" port="9500"/>
</Appenders>

into:

<Appenders>
  <Socket name="socket" host="localhost" port="9500">
    <SerializedLayout/>
  </Socket>
</Appenders>

We do, however, discourage the use of SerializedLayout and recommend JsonLayout as a replacement:

<Appenders>
  <Socket name="socket" host="localhost" port="9500">
    <JsonLayout properties="true"/>
  </Socket>
</Appenders>

Note that subsequent to the 2.9 release, for security reasons, Log4j does not process DTD in XML files. If you used DTD for including snippets, you have to use XInclude or Composite Configuration instead.

The Log4j 2.9.0 API, as well as many core components, maintains binary compatibility with previous releases.

GA Release 2.9.0

Changes in this version include:

New Features

  • LOG4J2-2008 Support printing multiple StructuredData elements in RFC5424Layout.
  • LOG4J2-1986 Public API for parsing the output from JsonLayout/XmlLayout/YamlLayout into a LogEvent.
  • LOG4J2-1981 JsonLayout, XmlLayout and YamlLayout support 0-byte termination of log events.
  • LOG4J2-1864 Support capped collections for MongoDb appender. Thanks to Matthias Kappeller.
  • LOG4J2-1813 Log4j2 will now print all internal logging to the console if system property `log4j2.debug` is defined with any value (or no value).
  • LOG4J2-1766 Temporary compress directory during rollover (#88). Thanks to Pierrick HYMBERT.
  • LOG4J2-1814 Added wrapper classes CustomLoggerGenerator and ExtendedLoggerGenerator to avoid class name with a dollar ($) character which has special meaning in many unix command line environments.
  • LOG4J2-1884 Added process ID (pid) pattern converter.
  • LOG4J2-1699 Configurable Log File Permissions with PosixFilePermission. Thanks to Demetrios Dimatos, Pierrick HYMBERT.
  • LOG4J2-1945 Generate source jas for all test jars.
  • LOG4J2-1934 JMS Appender does not know how to recover from a broken connection.
  • LOG4J2-1955 JMS Appender should be able connect to a broker (later) even it is not present at configuration time.
  • LOG4J2-1874 Added methods ::writeBytes(ByteBuffer) and ::writeBytes(byte[], int, int) to ByteBufferDestination interface and use these methods in TextEncoderHelper where possible to prepare for future enhancements to reduce lock contention. Thanks to Roman Leventov.
  • LOG4J2-1442 Generic HTTP appender.
  • LOG4J2-1442 Add with(String, primitive) methods to org.apache.logging.log4j.message.MapMessage.
  • LOG4J2-1930 Add forEach() methods to org.apache.logging.log4j.message.MapMessage.
  • LOG4J2-1932 Add containsKey() methods to org.apache.logging.log4j.message.MapMessage.
  • LOG4J2-1854 Support null byte delimiter in GelfLayout. Thanks to Xavier Jodoin.
  • LOG4J2-1359 Add support for Java 9 StackWalker.
  • LOG4J2-1880 Warn when a configuration file for an inactive ConfigurationFactory is found.
  • LOG4J2-1855 Add an optional random delay in TimeBasedTriggeringPolicy Thanks to Anthony Maire.
  • LOG4J2-1860 Shortcut to add Property and KeyValuePair component in ConfigurationBuilder.
  • LOG4J2-1294 The JMS Appender should use a JMS MapMessage for a Log4j MapMessage.

Fixed Bugs

  • LOG4J2-1833 Prevent NullPointerException when a file name is specified with the DirectWriteRolloverStrategy.
  • LOG4J2-2018 Fix incorrect documentation for LoggerNameLevelRewritePolicy.
  • LOG4J2-922 Parameter of mdcId in SyslogAppender has no default value. Thanks to angus.aqlu, Paul Burrowes.
  • LOG4J2-2001 StyleConverter.newInstance argument validation is incorrect. Thanks to Paul Burrowes.
  • LOG4J2-1999 HighlightConverter converts all unrecognized levels to DEBUG. Thanks to Paul Burrowes.
  • LOG4J2-2013 SslSocketManager does not apply SSLContext on TCP reconnect. Thanks to Taylor Patton, Gary Gregory.
  • LOG4J2-2016 Mark FileRenameAction as successful when using alternative ways to move files. Thanks to Benjamin Jaton.
  • LOG4J2-2012 No compression when using a separate drive in Linux. Thanks to Benjamin Jaton.
  • LOG4J2-1888 Log4j throws a java.nio.charset.UnsupportedCharsetException: cp65001. Thanks to Misagh Moayyed.
  • LOG4J2-1990 ConcurrentModificationException logging a parameter of type Map. Thanks to Philippe Mouawad.
  • LOG4J2-1311 SocketAppender will lose several events after re-connection to server. Thanks to Xibing Liang.
  • LOG4J2-1977 Consider the StringBuilder's capacity instead of content length when trimming. Thanks to Jerry xnslong.
  • LOG4J2-1971 Register log4j-core as an OSGi service. Skip tests for LOG4J2-1766 on MacOS. Use group "staff" for LOG4J2-1699 test on MacOS.
  • LOG4J2-1994 TcpSocketServer does not close accepted Sockets.
  • LOG4J2-1987 Log4J JUL Bridge and RMI Security Manager causes access denied ("java.util.logging.LoggingPermission" "control") Thanks to Andreas Felder.
  • LOG4J2-1982 Log4j-config.xsd only allows one AppenderRef element for each Logger element. Thanks to Christoph Lembeck.
  • LOG4J2-1985 Fix default buffer size to match documentation (from 8102 to 8192 a.k.a. 8KB.) Thanks to Kenneth McFarland.
  • LOG4J2-1912 CompositeConfiguration logs warning "Unable to determine URI for configuration." However, the reconfiguration is completed. Thanks to R Ri.
  • LOG4J2-1964 Dynamic reconfiguration does not work for filePattern of RollingFile. Thanks to Pierrick HYMBERT.
  • LOG4J2-1961 Reconfigure breaks DirectWriteRolloverStrategy. Thanks to Christian Vent.
  • LOG4J2-1943 The eventPrefix attribute was being ignored in the RFC5424Layout.
  • LOG4J2-1953 JndiManager is not released when the JmsAppender builder catches an exception trying to build itself.
  • LOG4J2-1911 Improve the documentation of the DynamicThresholdFilter.
  • LOG4J2-1929 EOFException with FormattedMessage. Thanks to Borys Sokolov.
  • LOG4J2-1948 Trim levels read from properties file to remove trailing spaces. Thanks to Michael Luck.
  • LOG4J2-1971 ClassCastException: org.eclipse.osgi.internal.loader.SystemBundleLoader$1 cannot be cast to java.lang.ClassLoader. Thanks to liwenxian2017.
  • LOG4J2-1876 More reliable checking for runtime dependencies.
  • LOG4J2-1867 Fix configuration documentation.
  • LOG4J2-1858 Ensure the ThreadLocal StringBuilder in ParameterizedMessage won't hold excessively much memory after logging a long message.
  • LOG4J2-1885 Fix documentation about default additivity value for loggers.
  • LOG4J2-1920 ScriptEngineManager is not available in Android and causes a NoClassDefFoundError. Thanks to Ajitha.
  • LOG4J2-1989 Clarify Javadoc for AbstractTriggeringPolicy. Thanks to Kenneth McFarland.
  • LOG4J2-1993 Fix compiler warnings in LoggerConfigTest. Thanks to Kenneth McFarland.

Changes

  • LOG4J2-2011 Replaced JCommander with picocli command line parser to let users run Log4j2 utility applications without requiring an external dependency.
  • LOG4J2-1928 Add support for DirectWriteRolloverStrategy to RollingRandomAcessFileAppender.
  • LOG4J2-2022 RFC5424Layout now prints the process id.
  • LOG4J2-2020 Remove default layout from KafkaAppender.
  • LOG4J2-2023 Use a class' canonical name instead of name to create its logger name.
  • LOG4J2-2015 Allow KeyStoreConfiguration and TrustStoreConfiguration to find files as resources.
  • LOG4J2-1984 Allow maxLength of StructuredData to be specified by the user.
  • LOG4J2-1071 Allow for bufferSize=0 in SMTP appender. Thanks to Ben Ludkiewicz, Benjamin Jaton.
  • LOG4J2-1261 Async Loggers no longer use deprecated LMAX Disruptor APIs. (Disruptor-3.3.3 or higher is now required.)
  • LOG4J2-1908 Improved error message when misconfigured with multiple incompatible appenders targeting same file.
  • LOG4J2-1954 Configurations with multiple root loggers now fail loudly.
  • LOG4J2-1958 Deprecate SerializedLayout and remove it as default.
  • LOG4J2-1959 Disable DTD processing in XML configuration files.
  • LOG4J2-1950 Fix docker build with jdk9 requirements (#84). Thanks to Pierrick HYMBERT.
  • LOG4J2-1801 Add more detail to WARN "Ignoring log event" messages printed to the console after log4j was shut down.
  • LOG4J2-1926 Facilitate log4j use in Android applications: remove dependency on RMI and Management APIs from log4j-api.
  • LOG4J2-1956 JMS Appender broker password should be a char[], not a String.
  • LOG4J2-1917 Support using java.util.ServiceLoader to locate Log4j 2 API providers.
  • LOG4J2-1966 Include separator option of PatternLayout in manual (and other updates). Thanks to M Sazzadul Hoque.
  • LOG4J2-1851 Move server components from log4j-core to new log4-server module.
  • LOG4J2-1991 Refactor SimpleMessage to be concise and clear (#100) Thanks to .
  • LOG4J2-2017 Update Jackson from 2.8.9 to 2.9.0.
  • LOG4J2-1868 Update ZeroMQ's JeroMQ from 0.3.6 to 0.4.0.
  • LOG4J2-1960 Update ZeroMQ's JeroMQ from 0.4.0 to 0.4.1.
  • LOG4J2-1974 Update ZeroMQ's JeroMQ from 0.4.1 to 0.4.2.
  • LOG4J2-1869 Update Kafka client from 0.10.1.1 to 0.10.2.0
  • LOG4J2-1962 Update Kafka client from 0.10.2.0 to 0.11.0.0
  • LOG4J2-1872 Update JavaMail from 1.5.5 to 1.5.6.
  • LOG4J2-1879 Update JAnsi from 1.14 to 1.15.
  • LOG4J2-1877 Missing documentation for Max index limit in DefaultRolloverStrategy. Thanks to Chandra Tungathurthi.
  • LOG4J2-1899 Add missing getters to classes in package org.apache.logging.log4j.core.net.ssl.
  • LOG4J2-1900 Update JAnsi from 1.15 to 1.16.
  • LOG4J2-](https Update SLF4J from 1.7.24 to 1.7.25.
  • LOG4J2-1938 Update Jackson from 2.8.7 to 2.8.9.
  • LOG4J2-1970 Update HdrHistogram from 2.1.8 to 2.1.9.
  • LOG4J2-1975 Update javax.persistence from 2.1.0 to 2.1.1.
  • LOG4J2-1976 Update org.osgi.core from 4.3.1 to 6.0.0.

Apache Log4j 2.9.0 requires a minimum of Java 7 to build and run. Log4j 2.3 was the last release that supported Java 6.

Basic compatibility with Log4j 1.x is provided through the log4j-1.2-api component, however it does not implement some of the very implementation specific classes and methods. The package names and Maven groupId have been changed to org.apache.logging.log4j to avoid any conflicts with log4j 1.x.

For complete information on Apache Log4j 2, including instructions on how to submit bug reports, patches, or suggestions for improvement, see the Apache Apache Log4j 2 website:

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

Comments:

Its a very informative post for me. Thanks.

Posted by terrariumtv on October 26, 2017 at 12:43 AM UTC #

Many of uses this Apache framework application while making projects.

Posted by Spotify application not responding on November 20, 2017 at 07:22 AM UTC #

Loved it. Thanks For sharing this with us. Fix Your Technical Problem With Fixingblog. Are you Facing Problem With Your Norton Antivirus? We are Providing free Support For Norton. Visit https://fixingblog.com/www-norton-comsetup-activation-installation-norton/

Posted by Fixingblog on January 29, 2018 at 09:32 AM UTC #

Good article shares by you please also visit. Http://articleblend.com/ctrls-datacenters-ltd-salary/

Posted by Articleblend on April 05, 2018 at 04:36 PM UTC #

hey this is post is cool. Please also visit http://articleblend.com/ for more useful information

Posted by articleblend on April 06, 2018 at 11:21 AM UTC #

Love the way you work on your scripts, they are really hopeful for people like me, check out http://musicallycrown.club

Posted by Sara Deville on April 07, 2018 at 03:46 PM UTC #

The package names and Maven group Id have been changed http://printcalendartemplates.com/

Posted by jilan ali on April 13, 2018 at 01:02 PM UTC #

A versatile logging framework for PHP.

Posted by Emily John on April 24, 2018 at 08:17 AM UTC #

Awesome and nice

Posted by Visit here on May 03, 2018 at 05:24 AM UTC #

I really like ur article n I have learned alot from this post..

Posted by johan on May 04, 2018 at 02:24 PM UTC #

Please also visit https://www.ultimate-tech-news.com/skype-push-to-talk/

Posted by sami on May 04, 2018 at 02:25 PM UTC #

I really like your article and I will likely to share it on my facebook page. Please Also check my website called http://filmyyaar.com/ if you want to get latest updates about latest films. Then please check my website once.

Posted by Shirley Setia on May 21, 2018 at 11:21 AM UTC #

Malwarebytes Contact Support is straightforward, however you may discover a few problems while utilizing this product. These problems are essentially specialized issues. When you run over the specialized issues, you have to determine them with legitimate investigating measures. Call us : US : +1-888-254-4408 UK : +44-0808-234-2376 AUS : +61-1-800-985-062 http://sitronicssupport.com/malwarebytes-support

Posted by Malwarebytes Customer Support 1-888-254-4408 on June 06, 2018 at 08:51 PM UTC #

norton.com/setup to install setup product key, Learn how to download, install, and activate Norton Setup on your Windows and Mac device. Call us : US : +1-888-254-4408 UK : +44-0808-234-2376 AUS : +61-1-800-985-062 http://norton-setup-install.com

Posted by norton.com/setup on June 06, 2018 at 08:52 PM UTC #

norton.com/setup to install setup product key, Learn how to download, install, and activate Norton Setup on your Windows and Mac device. http://nortonnortonsetup.com

Posted by norton.com/setup on June 07, 2018 at 10:14 PM UTC #

The Norton Products for which we give bolsters are Norton Security, Norton 360, Norton Internet security, Norton Software for Mobile, Norton Deluxe, Norton standard and other Norton Products. You can introduce them utilizing a CD Drive or Online from you dashboard of Norton account.http://nortoncom.org/

Posted by norton.com/setup on June 08, 2018 at 08:37 PM UTC #

Norton Setup with your product key online. Download &amp; Install Norton Product, Visit activation website norton.com/setup to register you code.http://nortonsetup-setup.com

Posted by Norton Setup on June 12, 2018 at 07:14 AM UTC #

www.mcafee.com/activate - Activate Your McAfee Retail card by simply visiting our website mcafee.com/activate and Get Started with McAfee Security. http://wwwmcafeecomactivate.org

Posted by www.mcafee.com on June 12, 2018 at 01:05 PM UTC #

Thank you for sharing this article. My tree surgery company is learning everyday about your set up. https://treesurgeonbedford.co.uk

Posted by Jack on June 14, 2018 at 01:57 PM UTC #

I used to visit this website because of this web page content genuine information. If you are experiencing trouble with downloading movies visit http://techvaidya.com/free-movie-download-sites-2018/

Posted by Movie Downloader on June 15, 2018 at 09:25 AM UTC #

when i visiting this site I found cool and interesting here keep sharing kindly check it out https://sbionlinehelp.tumblr.com/

Posted by Rebbeca on June 27, 2018 at 11:22 AM UTC #

Thank you for sharing an excellent article! https://www.kwikflow.com

Posted by Kevin on July 05, 2018 at 04:39 PM UTC #

BT Mail - Login, Sign up, Sign in, Reset Password etc using BT ID or BT Email. Log in to BT Yahoo Mail or BT Sign in at BT UK Account. BT Mail at BT email address with domain “@btinternet.com”.

Posted by BT Mail on July 06, 2018 at 07:21 AM UTC #

Telstra Webmail - Telstra Login using Telstra ID & Access Telstra My Account. Also, use Bigpond Webmail using Bigpond Login. TELSTRA 24x7 - MY ACCOUNT <a href="http://telstra-webmail.com/"> Telstra Webmail</a>

Posted by Telstra Webmail on July 06, 2018 at 07:22 AM UTC #

Roadrunner Email - TWC Email Login at RR.com or rr com. Roadrunner Webmail Access by Roadrunner Login, Sign in, Sign up etc. Time Warner Email or RR Mail Login Today by using TWC ID. <a href="http://roadrunner-email.com/"> Roadrunner Email</a>

Posted by Roadrunner Email on July 06, 2018 at 07:23 AM UTC #

Bell Mail - Bell Email Login, Sign in, Sign up, Bell Password Reset etc at Bell Webmail. Sympatico Bell Login Access using Bell ID and Password. <a href="http://mybellmail.com/"> Bell Mail</a>

Posted by Bell Mail on July 06, 2018 at 07:24 AM UTC #

Great framework thanks for sharing, could I get your source code to make me easier and clear. https://www.wadav.com/tech/powerful-and-affordable-cybersecurity-with-bitdefender

Posted by Wadav on July 08, 2018 at 04:02 PM UTC #

Epson or Seiko Epson Corporation is a Japanese Company which is one of the world’s largest of Printers and imagining related equipment. With growing demand for a printing device, the technology around printing products is increasing too. This what Epson Printer deliver with their new and upgraded Printers.pson printer support

Posted by epson printer support on July 16, 2018 at 09:33 AM UTC #

Brother is another popular Printer company which manufactures advanced printing device and accessories for both personal and business use. It is a Japanese company which sells their products both online and offline, from stores.

Posted by Brother printer support on July 16, 2018 at 09:35 AM UTC #

Reset AOL Mail Password – If you are a user of AOL Mail then you are aware of a great many features of AOL Mail and must have experienced them. The AOL Mail has very user-friendly ways to deal with the issues of their customer’s issues too. Such as in case you forget your password and want to change it for good. You can follow these steps to Reset AOL Mail Password.

Posted by Reset AOL Mail Password on July 16, 2018 at 12:55 PM UTC #

thanks for the information and also read my latest blog about creating many Gmail account without phone number verification here - http://bit.ly/2uyAS9H and after reading the article you will be able to do the work without any more needs. :)

Posted by Johnwick23 on July 18, 2018 at 03:16 PM UTC #

visit the website and let us know how do you feel about the guide - https://goo.gl/CqmHMN

Posted by Haxrs on July 18, 2018 at 03:18 PM UTC #

I appreciate this post,real stuff

Posted by Intuit Quickbooks Support on July 20, 2018 at 10:29 AM UTC #

Fitness7 is <a href="http://www.fitness7.in/">Best Gym in Surat</a> for Personal Trainers and Weight Loss - Fitness7. Fitness7 Gym leads the fitness industry when it comes to helping people reach their fitness goals. We have Cross-fit courses, a full weight room, multiple cardio areas, personal training, group classes, and more!

Posted by Best Gym in Surat on July 31, 2018 at 07:45 AM UTC #

Really appreciate the work you have done on your blog. Keep up the good work! http://www.arbuk.co.uk

Posted by James on August 14, 2018 at 01:55 PM UTC #

Great site and really apprecitate the effort https://www.buyersguidex.com/ninja-fortnite-settings-config/ and please do post more.

Posted by David John on August 14, 2018 at 02:42 PM UTC #

Post a Comment:
  • HTML Syntax: NOT allowed

Calendar

Search

Hot Blogs (today's hits)

Tag Cloud

Categories

Feeds

Links

Navigation