Apache Logging Services

Monday September 26, 2016

A sneak peak into Log4j 2.7

Log4j 2.7 will be released in a few days. The community is now reviewing the release for any last minute showstopper. Meanwhile, you may be interested in a sneak peek into what is coming.

Log4j 2 is nominated for the JAX Innovation Awards!

Do you like its performance, garbage-free logging, and easy and flexible configuration?

Log4j 2 needs your love. Vote for Log4j 2!

Voting closes September 29th, 2016.

Scala API

Log4j 2.7 includes a Logging trait that removes some boilerplate code. Your Scala code can now look like this:
import org.apache.logging.log4j.scala.Logging
class MyClass extends BaseClass with Logging {
  def doStuff(): Unit = {
    logger.info("Doing stuff")
This also enables a more compact form of parameterized logging. Instead of the common Java form:
logger.debug("Logging in user {} with birthday {}", user.getName(), user.calcBirthday());
In Scala, you can use string interpolation to achieve this:
logger.debug(s"Logging in user ${user.getName} with birthday ${user.calcBirthday}")

Non-Blocking Queues in Async Appender

In addition to Log4j 2's Asynchronous Loggers, which are based on the LMAX Disruptor library, the 2.7 release allows you to configure the Async Appender to use a different queue implementation, including a few non-blocking ones:
  • ArrayBlockingQueue - This is the default implementation that uses ArrayBlockingQueue
  • LinkedTransferQueue - This uses the JDK LinkedTransferQueue which was introduced in Java 7.
  • JCToolsBlockingQueue - This uses the MPSC bounded lock-free queue in JCTools.
  • DisruptorBlockingQueue - This uses the Conversant Disruptor BlockingQueue. (Not to be confused with the LMAX Disruptor.)

Custom Context Data Injection

Context data is data that is set by the application to be included in all subsequent log events. The default source for context data is the ThreadContext.

From Log4j 2.7, users can configure a custom ContextDataInjector that can

  • take context data from any source, and
  • use values of any type (not just Strings).
In addition, the ThreadContext map is now garbage-free. This is disabled by default, users need to enable this explicitly.

...and much more

RoutingAppender can now be configured with scripts, a new ScriptAppenderSelector was introduced that creates an Appender specified by a Script, FileAppender (and its Rolling equivalent) can now create files on-demand, and there are various other improvements.

Vote For Us!

Log4j 2 is nominated for the JAX Innovation Awards!

Do you like its performance, garbage-free logging, and easy and flexible configuration?

Log4j 2 needs your love. Vote for Log4j 2!


Thank you very much! saved me over here! :)

Posted by Niccolo on September 30, 2016 at 08:27 PM UTC #

If you are need the any window10 related help to ask the more question on this best platform. this is the one of the best http://gethelpwindows10.com full satisfied option of the user are agree to enjoy the one best useful option on this website.

Posted by Akki12 on February 02, 2019 at 05:13 AM UTC #

cinderella solution flavor pairing and carb pairing weight loss https://cinderellasolution.net/

Posted by Carly Donovan on July 18, 2019 at 07:02 AM UTC #

Ammmmazing! Absolutely fantastic and inspiring!!

Posted by sintroïde on July 20, 2019 at 05:13 PM UTC #

Amazing article! presented in a great way. I read all the informative articles here on home remedies for gonorrhoea here - http://www.honeybeenutrition.com/home-remedies-for-gonorrhea/

Posted by HoneyBeeNutrition.com on July 27, 2019 at 03:59 PM UTC #

Incredible post! This is greatly amazing. Thanks! <a href="https://accesselitenow.com/">access elite doctors</a>

Posted by Danny on September 11, 2019 at 01:20 PM UTC #

I agree great stuff!!! :)

Posted by Casimob on September 12, 2019 at 06:26 AM UTC #

Post a Comment:
Comments are closed for this entry.



Hot Blogs (today's hits)

Tag Cloud