Jeff Shaw | 16 Apr 21:55 2014

How to make a custom connection source available in log4j 2 config?

I made a custom connection source that I want to use. (Source follows
this message.) However, when I attempt to use my BoneCP connection
source in my config, I get the error, "ERROR JDBC contains an invalid
element or attribute "BoneCP"". What else do I need to do to make my
custom connection source available in the configuration?

I'm hoping the answer will also apply to a custom appender and manager
I've written, neither of which work because they also cannot be
instantiated from the configuration, however the error is a class not
found error.



 * Copyright (c) Bit Gladiator on 2014.

 <at> Plugin(name = "BoneCP", category="Core", elementType =
"connectionSource", printObject = true)
public class BoneCPConnectionSource implements ConnectionSource {
  private static final Logger LOGGER = StatusLogger.getLogger();

  private final BoneCP pool;

  private BoneCPConnectionSource(final BoneCP pool) {
    this.pool = pool;
(Continue reading)

Vin Karthik | 15 Apr 05:37 2014

Fw: News



Vin Karthik

David KOCH | 15 Apr 15:10 2014

Issue with log4j and Glassfish


Glassfish 3.1.2 does not seem to find (some) log4j2 classes when the log4j2
dependencies are not directly included in the wep application's pom.xml. In
my case, I have a separate artifact which contains a custom log appender
and all of the log4j2 stuff.

I already followed the advice in
LPS-21525<> to
help avoid some errors but I still get the following messages when trying
to deploy my application,

while trying to load Bean Class
org.apache.logging.log4j.core.async.RingBufferLogEvent$Factory :
java.lang.NoClassDefFoundError: com/lmax/disruptor/EventFactory|#]

See here <> for a verbose list.

The classes are present in the web application's jar, albeit in:

How can I fix this? Any help is appreciated,


Mahesh Dilhan | 10 Apr 04:24 2014

Catalina.out trace : memory leak


I got following catalina console out continuously  when I try to stop the
 web application.

Brief  on configuration
*version : rc1*


<Configuration status="OFF" >
    <RollingRandomAccessFile name="RollingFile-${web:contextPath}"
immediateFlush="false" append="false"

        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
        <TimeBasedTriggeringPolicy />
    <Root level="INFO" includeLocation="false">
      <AppenderRef ref="RollingFile-${web:contextPath}"/>

(Continue reading)

Manuel Teira | 9 Apr 09:57 2014

Compressing only old rollover files

Hello all,

I'm evaluating a switch to log4j-2 since my application is required to
rollover files by age and size (for what the composite triggering policies
come handy). The rollover files shall also be compressed, but only those
reaching a given age.

What would be the preferred approach to achieve that using log4j-2? Should
be reasonable to write a custom rollover strategy or is there any other way
out-of-the box that may work?

Thanks and best regards,

Matt Sicker | 6 Apr 03:10 2014

Slides for my upcoming Introduction to Log4j 2 talk at ApacheCon 2014

I submitted these a bit late due to not noticing when we were supposed to submit them, but I finished them! Attached is a PDF rendering of the slides (hopefully this works).

Matt Sicker <boards <at>>

To unsubscribe, e-mail: log4j-user-unsubscribe <at>
For additional commands, e-mail: log4j-user-help <at>
Arkin Yetis | 4 Apr 21:04 2014

Flume Appender failure due to filesystem issue

We use the Flume Appender. Our logging stopped after a certain point in
time and we noticed the exception at the end of this message in our
application logs. It looks like there was an issue with the filesystem. But
although the filesystem has recovered, the appender (or probably the
persistence mechanism it uses) was stuck in this state and it took an
application restart for it to continue logging. It does not look like there
is a recovery mechanism or if there is one it failed.
Would you like me to open a log4j JIRA ticket for this? Or is this
something that can be prevented by something simple you can share over
e-mail such as a certain configuration setting?

- Arkin

Exception stack is:
1. Stale NFS file handle ( (null)
2. Environment invalid because of previous exception: (JE 5.0.73)
/app/logs/abs-workflow/flumeDir Stale NFS file handle
LOG_READ: IOException on read, log is likely invalid. Environment is
invalid and must be closed. fetchTarget of 0x542/0x4af13c parent IN=5 IN lastFullVersion=0x543/0x62d6c5
lastLoggedVersion=0x543/0x62d6c5 parent.getDirty()=true state=0
( (null)

Root Exception stack Stale NFS file handle
    at Method)
Mohit Anchlia | 2 Apr 19:00 2014

Non blocking JMS appender

I am trying to configure log4j such that the jms appender is non blocking.
Does this configuration make it non blocking?

   <appender name="async" class="org.apache.log4j.AsyncAppender">
        <param name="BufferSize" value="4096" />
        <param name="blocking" value="false"/>

    <appender name="search-indexer-async-jms"
        <param name="InitialContextFactoryName"
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory" />
        <param name="ProviderURL" value="tcp://localhost:61616"/>
        <param name="TopicBindingName" value="indexTopicEndpoint"/>
        <param name="TopicConnectionFactoryBindingName"

        <appender-ref ref="async" />
Mohit Anchlia | 1 Apr 21:01 2014

Unit testing log4j JMS Appender

I am trying to unit test log4j with jms appender, however even before I
bring up the jms embedded broker service get loaded and it
fails to connect to the broker. Is there a way to reload log4j after the
broker is up?
James Hutton | 30 Mar 07:42 2014

Merging log4j2 contexts

I'm looking to leverage log4j2 in a spring application that uses spring
profiles heavily.  I know in log4j1.2 we could use the DOMConfigurator to
parse an additional xml and merge it into the context.

Rebecca Ahlvarsson | 29 Mar 04:03 2014

Running disruptor async performance tests

I am trying to run the async performance tests described on the link below
on my machine.

I am not an expert with log4j, so here is how far I got after building
log4j with maven:

java -cp
org.apache.logging.log4j.core.async.perftest.RunLog4j2 blah blah.log 1

Then I get this in the output:

avg=17 99%=32 99.99%=64 sampleCount=5000000
9962247 operations/second

The questions I have are:

1. It looks like the source code IPerfTestRunner uses a much shorter
message "Short Msg" instead of the 500 characters message stated in the
link above. Is that intentional or is it a bug? Do we want to test the
latency with the 500-character message or just a short message?

2. I notice that my logs are NOT going to any file. I am probably
misconfiguring something with log4j. How do I generate a file with the
messages from the performance test?

3. I just want to test with one asynchronous logging thread, so I am
passing threadCount 1 above. What does the second parameter 'blah' mean?

4. Not sure why I get operations/seconds if I am not passing -throughput in
the command-line. I just want to get the latency numbers for now. After
that I will worry about throughput.

So basically I just want to run the same test you run to see those great
numbers on my production machine.

Thanks for the help!