Theresa.Niederberger | 30 Jul 11:46 2015

Question about LOG4J2-673 (plugin preloading fails in shaded jar files)


we use the maven-shade-plugin and have recently moved from log4j to 
log4j2. Since we define a custom appender, we now we have the problem 
described in Jira Task  LOG4J2-673 (

My question is: since the task is assigned critical, is there a chance 
that a fix will be included in the next version 2.4? If yes, when will 
this version be released? If no, which workaround do you recommend? The 
one suggested by Eduard Gizatullin?

Thanks for your help!
Liang, Hsuan Tzu | 30 Jul 02:45 2015

Set log level while running integration test

Hello everyone,

I am currently encountering a problem that I need to set the log level of a certain class while running
performance test to prevent too many outputs. But while running unit tests, the logs need to be printed out.

This can easily be achieved by setting the log level in the performance test code dynamically, but I am
wondering if there is any way to configure it using the "" file. Is it possible to specify
the level of a certain logger for different class that are using it?
log4j.logger.a=debug, while running performance test
log4j.logger.a=info, while running unit test

David KOCH | 27 Jul 12:17 2015

Send StatusLogger output to Syslog appender


How do I configure log4j2 to send StatusLogger output to a Syslog appender?

Our application runs on several instances and logs to a remote instance for
centralised logging, however status logging only appears in the logs on
each instance.

Thank you,

Benjamin Jaton | 24 Jul 21:17 2015

File monitor - reload DefaultRolloverStrategy


I am using this configuration :

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG"* monitorInterval="2"*>
    <RollingFile name="RollingFile" fileName="/tmp/test/app.log"
        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
        <SizeBasedTriggeringPolicy size="100KB"/>
      *<DefaultRolloverStrategy max="5"/>*
    <Root level="info" includeLocation="false">
      <AppenderRef ref="RollingFile"/>

I am changing the DefaultRolloverStrategy "max" attribute from 5 to 10.
I can see the reloading take place from the StatusLogger (full log

*DEBUG Starting configuration
(Continue reading)

Mike Guo | 23 Jul 12:36 2015

log4j2 initialize Log4j failed

Hi, all.

I tried to use log4j2 under tomato 8.x.  

when I deploy my application to tomcat 8.x, the compile success and install deploy success. 
but the application can’t be start, I checked the tomcat log:

371 ERROR StatusLogger LogManager returned an instance of
org.apache.logging.slf4j.SLF4JLoggerContextFactory which do     es not implement
org.apache.logging.log4j.core.impl.Log4jContextFactory. Unable to initialize Log4j.
 372 23-Jul-2015 18:24:38.008 SEVERE [http-nio-8080-exec-26]
org.apache.catalina.core.StandardContext.startInternal On     e or more Filters failed to start. Full
details will be found in the appropriate container log file
 373 23-Jul-2015 18:24:38.009 SEVERE [http-nio-8080-exec-26]
org.apache.catalina.core.StandardContext.startInternal Co     ntext [/51ershouwang] startup failed
due to previous errors
 374 23-Jul-2015 18:24:38.064 INFO [http-nio-8080-exec-26]
org.apache.catalina.startup.HostConfig.deployWAR Deployment      of web application archive
/usr/local/tomcat8024/webapps/51ershouwang.war has finished in 2,408 ms

would you please help me take a look about this issue?

thanks so much


kusmanjali | 22 Jul 08:01 2015

Log4J2 NoSQL query

1. Most of the logging frame works use a log forwarder + queue
mechanism(Logstash, Fluectd) to store logs into database. What is the
advantage of using this over using Log4j NoSQL appenders to write directly
to the database.

2. Any material/link to get more insight into how log4j2 handles the
database connection and failover. And how we can scale this architecture to
store logs from multiple servers into a single database.

Our idea is to build a central logging system just by using Log4 and doing
away with forwarders and queues.


with regards
Kusmanjali Jenamoni
Benjamin Jaton | 22 Jul 00:45 2015

JDBC Appender : how to have the pattern produce NULL?


I am using the JDBCAppender:

  "type" : "Jdbc",
  "name" : "MyDatabaseAppender",
  "tableName" : "LOGS",
  "ignoreExceptions" : "false",
  "ConnectionFactory" : {
    "class" : "test.ConnectionFactory",
    "method" : "getDatabaseAppenderDataSource"
  "Column" : [
     { "name" : "ID", "pattern" : "%X{ID}", "isUnicode" : "false" },
     { "name" : "NUM", "pattern" : "%X{NUM}", "isUnicode" : "false" }

As you can see, I am using the ThreadContext to pass the variables.

ThreadContext.put("ID", id++);
ThreadContext.put("NUM", "41");

The NUM column is of type BIGINT, and is nullable.

I am trying to set it to NULL with:
  ThreadContext.put("NUM", "NULL");
  ThreadContext.put("NUM", null);
(Continue reading)

Gary Gregory | 19 Jul 20:26 2015

Re: Print the LoggerContext name

And you have your web app configured per ?


On Sat, Jul 18, 2015 at 8:30 PM, Clément Guillaume <cguillaume <at>>

> Yes, I trying to print the servletContext.servletContextName using the
> WebLookup (${web:servletContextName}). But it doesn't work for now.
> On Sat, Jul 18, 2015 at 8:26 PM, Gary Gregory <garydgregory <at>>
> wrote:
> > So you are using servletContextName?
> >
> > Gary
> >
> > On Sat, Jul 18, 2015 at 8:19 PM, Clément Guillaume <
> cguillaume <at>
> > >
> > wrote:
> >
> > > Hi, thank you for your answers,
> > >
> > > My primary goal is to is to print the WebApplication name. I found here
> > > <>
> > > that
> > > by default the LoggerContext name is the WebApplication name.
> > >
(Continue reading)

Benjamin Jaton | 16 Jul 18:25 2015

SNMP Appender


Do you know if there is any implementation of an SNMP appender for log4j2?

I found this but I think
it is exclusively for log4j1.

Mikael Ståldal | 16 Jul 10:49 2015

FATAL Unable to register shutdown hook because JVM is shutting down.

I sometimes get the message:
FATAL Unable to register shutdown hook because JVM is shutting down.

This happens in a short running batch job.

Can it be so that Log4j did not have time to initialize fully before
shutting down? What can be done about it?

Log4j 2.3.


[image: MagineTV]

 *Mikael Ståldal*
Senior backend developer

 *Magine TV*
 mikael.staldal <at>
 Regeringsgatan 25  | 111 53 Stockholm, Sweden  |

 Privileged and/or Confidential Information may be contained in this
message. If you are not the addressee indicated in this message
(or responsible for delivery of the message to such a person), you may not
copy or deliver this message to anyone. In such case,
you should destroy this message and kindly notify the sender by reply
Saurabh Jain | 16 Jul 06:05 2015

Log4j2 over log4j

Hi list

We want to migrate to log4j2 from log4j
But I need to convince the client by showcasing its advantages.
Do we have some portal or link where I can get the advantages sort of
comparison thing.