konrad.mrozek | 27 Oct 18:25 2014

Logging level based on context name


I'm working in a project where we have few applications that have to use logs structure forced by client. I
want to use the same configuration file but separate log files. I thought about using "contextName"
property to generate file names for appenders. I also wanted to use automatic reconfiguration
(monitorInterval) but I stumbled upon one problem.

E.g. All applications use Spring. I wanted to set higher logging level for Spring in one of the
applications. Is it possible to set logging level for package for given context name? I've searched for
specific attribute/tag but I couldn't find one.


Alexander Lehmann | 26 Oct 23:32 2014

log4j2 how to write a wrapper that passes the class name of my own

 I am trying to write a log wrapper for log4j2 for a application server
that uses it's own logger with a wrapper for log4j 1.2, slf4j or JUL.

To be able to log method names and line numbers, the log4j 1.2 wrapper
currently passes the class name of the Logger to the log() method to
make it possible to log the correct method, otherwise only the log
method of the wrapper class is logged.
I am not able to figure out how to do that with log4j2 where the log
methods do not have a parameter for the class name.

(On a side-note, when I use log2j 1.2 and the log4j 1.2-api for log4j
2.x, logging method names works, so I'm probably missing something obvious)

Thanks for your help
bye, Alexander


Alexander Lehmann <alexlehm <at> gmail.com>
Marcus Meier | 24 Oct 21:11 2014

Trouble using Log4J 2.1 in Eclipse

I'm having trouble getting Log4J 2.1 to recognize my log4j2.xml file. I'm
setting it up with SLF4J but I removed SLF4J from my project and the
problem persists. I've documented everything in a StackOverflow post but
haven't received a response from there yet. I'm hoping someone on this list
will be able to help.

Stack Overflow Post: http://stackoverflow.com/q/26552518/1582758
Ralph Goers | 24 Oct 17:27 2014

[ANNOUNCEMENT] Apache Log4j 2.1 released

The Apache Log4j 2 team is pleased to announce the Log4j 2.1 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 of the improvements available in Logback while fixing some inherent problems in Logback's

This is the fourth GA release which contains several bugfixes and new features. There are two
new Maven artifacts in this release: log4j-jul and log4j-iostreams. Both components are API-based
with optional Core features.

GA Release 2.1

Changes in this version include:

New features:
o LOG4J2-868:  Add ShutdownCallbackRegistry interface for customizable shutdown callback handling.
This is particularly
        useful for application servers that wish to integrate with Log4j 2. 
o LOG4J2-589:  Supported filtering on custom log levels in configuration. 
o LOG4J2-856:  Documentation: add sections on the JUL Adapter, IO Streams and NoSQL Appenders to the Maven
and Ivy page. 
o LOG4J2-848:  Add a Java lookup to provide nicely formatted runtime version information. 
o LOG4J2-809:  Move reflection utility class to API's private utility classes. 
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. 
(Continue reading)

Daniel Widdis | 17 Oct 17:49 2014

HipChat Appender

We've just switched our logging framework to log4j2 and are enjoying its 

The SMTP appender looks nice but we tend to avoid email and use HipChat 
for a lot of our code team communications.  I've searched the web for a 
log4j2 Hipchat appender and don't see one out there... i've found one 
for logback and for log4net.  Does anyone know if one exists?   And/or 
is willing to port the code from the other frameworks?

sujatha rdn | 6 Oct 10:47 2014

Issue with configuration status and Rolling Files


I have migrated to log4j2 with slf4j adapter. But I am facing some issues.

1.       When I add configuration status <configuration status=”trace”> I
don’t see any logs related to log4j in my catalina logs

2.       And also, I have 5 loggers mapped to 5 different rolling files.
But only 4 files get created in the specified location and in that only one
files gets updated with the logs.

Here are some details that you want to know before you suggest me a

1.       I am working on servlet 2.5 web application and our container is
tomcat 7.

2.       I am using slf4j adapter as interface in my application to access

Do please let me know if you need any further details to help me out.


Mickael Marrache | 18 Sep 18:53 2014

Ignoring log event after log4j was shut down


I just started to use Log4j 2 with the asynchronous logger feature, I
followed the guide but after a running a unit test, I always get the
following log entry at the end instead of the last line I expect:

2014-09-18 16:45:56,030 FATAL Ignoring log event after log4j was shut down

If I disable remove the Log4jContextSelector  system property, I can see the
last log entry instead of the error.

I guess the log4j engine is shut down and therefore it ignores the log
entry? If yes, why it is not shut down after the test ends?



Christian Müller | 8 Sep 17:22 2014

Logging requirement for PCI (payment card industry)

Hello list!

For PCI requirement 10.2.6 (Initialization, stopping, or pausing of the
audit logs) [1], I'm wondering what the best solution would be from your
point of view?

The PCI requirement are detailed further in the spec:
Verify the following are logged:
 - Initialization of audit logs
 - Stopping or pausing of audit logs

Turning the audit logs off (or pausing them) prior to performing illicit
activities is a common practice for malicious users wishing to avoid
detection. Initialization of audit logs could indicate that the log
function was disabled by a user to hide their actions.

The PCI auditor told us, "it's enoght" if the application logs when it's
started and when it's stopped.

[1] https://www.pcisecuritystandards.org/documents/PCI_DSS_v3.pdf

Thanks in advance,

Software Integration Specialist

Apache Member
V.P. Apache Camel | Apache Camel PMC Member | Apache Camel committer
Apache Incubator PMC Member
(Continue reading)

Gary Gregory | 8 Sep 14:46 2014

[survey] What version of Java do you use?


What version of Java do you use with Log4j 1?
What version of Java do you use with Log4j 2?

Thank you,


E-Mail: garydgregory <at> gmail.com | ggregory <at> apache.org
Java Persistence with Hibernate, Second Edition
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory
Manikumar Reddy | 5 Sep 14:15 2014

log4j2 Slow Starup


I am using log4j 2.0.2. I have 20 rolling file appenders.
log4j initialization is taking more than 20 seconds.

java stack trace is showing  PluginManager.collectPlugins code.

Is there any way to reduce the startup time?
Is it possible to disable the plugin find process?

Remko Popma | 5 Sep 09:27 2014

Re: How to disable Serialized plugin listing files on classpath - Initialization slowness

This may be related to LOG4J2-798. 
Feel free to attach your config to that Jira (or a new one if this is different) if it demonstrates the issue or
can help us reproduce the issue. 

Sent from my iPhone

> On 2014/09/05, at 15:46, Kamal C <kamaltarget <at> gmail.com> wrote:
> Hi
> During my testing Log4j 2 takes considerable amount of time to initialize.
> In my log4j2.XML, i have around 40 Rolling file appenders and a console
> appender. It took 22-25 seconds to initialize all of them. I have seen them
> by turning on TRACE level logs.
> I had gone through Log4j2 docs, they said PluginManager looks for custom
> plugins in the class-path and the packages in the configuration of
> log4j2.xml. I gave my required packages to look for custom plugins in
> configuration.
> To disable seriailzed listing of files , during my compilation time i run
> the following command
> javac -d . -cp "MY_CLASSPATH" -proc:only -processor
> org.apache.logging.log4j.core.config.plugins.processor *.java
> It created a META-INF folder in my class-path which it contains one
> Log4j2Plugins.dat file. Then i started my testing, even then it takes 20-22
> seconds to initialize. How should i minimize the initialization time?
> Any help would be greatly appreciated.
(Continue reading)