Richard Kolb | 24 Mar 09:12 2015

Intermittent log file compression issue


I am using log4j 2.2 on Windows 2008 using Java 7 and I'm experiencing an
intermittent issue where my log files used to compress, but now just move
to the archive directory uncompressed.

To debug, I changed the file pattern to be on the minute level (in bold),
and I am getting the same issue

Any help would be greatly be appreciated..


<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="TRACE" name="API" packages=""  monitorInterval="30">
    <RollingRandomAccessFile name="CatchAll" fileName="logs/all.log"
immediateFlush="false" append="true"
        <Pattern>%d %m%n</Pattern>
                <TimeBasedTriggeringPolicy interval="1" modulate="true" />
                <SizeBasedTriggeringPolicy size="2 GB"/>
            <DefaultRolloverStrategy max="20"/>
    <RollingRandomAccessFile name="Audit" fileName="logs/audit.log"
(Continue reading)

Mikael Ståldal | 23 Mar 18:40 2015

Strage warning about MessageFactory mismatch

I get the following strange warning from Log4j 2.2:

WARN The Logger MyLogger was created with the message factory
org.apache.logging.log4j.message.MessageFormatMessageFactory <at> 516986e6 and
is now requested with a null message factory (defaults to
org.apache.logging.log4j.message.ParameterizedMessageFactory), which may
create log events with unexpected formatting.

I have these libraries in my classpath:

Why do I get this warning? The logging seems to work properly.


[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
(Continue reading)

Giovanni De Martino | 20 Mar 08:56 2015

Simplest way to querying multiple collections with similar documents

Hi all,
I've to manage a MongoDb instance used in order to collec application log
entries from several applications servers.

All log entries (mongoDb documents) have the same data structure (id,
timestamp, error_code, message, etc.)
For some requirements specific to my context I need to save this documents
on several different collections on the same MongoDb database.

Which is the way in order to query among all the collections in order, for
example, to find all log entries in a specific interval of time, or with a
specific error_code, etc.?

Currently I'm using MongoDb 2.6 and I'm planning to move to MongoDB 3.0

Many thanks in andvance.
Regards, giovanni


Giovanni De Martino <at>
Dominik Psenner | 19 Mar 20:51 2015

Apache Con

Dear Apache Logging enthusiast,

In just a few weeks, we'll be holding ApacheCon in Austin, Texas, and we'd
love to have you in attendance. You can save $300 on admission by
registering NOW, since the early bird price ends on the 21st.

Register at

ApacheCon this year celebrates the 20th birthday of the Apache HTTP Server,
and we'll have Brian Behlendorf, who started this whole thing, keynoting
for us, and you'll have a chance to meet some of the original Apache Group,
who will be there to celebrate with us.

We've got 7 tracks of great talks, as well as BOFs, the Apache BarCamp,
project-specific hack events, and evening events where you can deepen your
connection with the larger Apache community. See the full schedule at

And if you have any questions, comments, or just want to hang out with us
before and during the event, follow us on Twitter -  <at> apachecon - or drop by
#apachecon on the Freenode IRC network.

Hope to see you in Austin!
Giovanni De Martino | 18 Mar 22:40 2015

Fwd: Log4j 2.x AsyncLogger

Hi all,
I'm currently using Log4j 2.1 in a production environment.
I'm using all Async Logger with a RingBuffer of around 130.000 entries and
then an AsyncAppender towards MongoDB.
I'd like to kindle ask you following question:
what happen is the RingBuffer of the AsynLogger (not the Async Appender)
become full?
It is a blocking buffer or old log entries not even passed to the appender
are discarded and new ones overwrite then into the ring?

Many thansk, giovanni


Giovanni De Martino <at>
jeremy | 9 Mar 23:59 2015

Question about AsyncAppender vs FailoverAppender

After a quick code inspection it appears that AsyncAppender does not treat
running out of space in its ring buffer as an exception.

If we were to configure AsyncAppender with

blocking false
ignoreExceptions false
and no errorRef

When it runs out of space in the ring buffer it will log an error message,
but not raise an AppenderLoggerException.

Q: Is my understanding of the above accurate?

I understand that intention is to use errorRef to failover to another
appender, however, FailoverAppender offers a much more developed idea of
failover (eg retry interval and multiple failovers) . What's the benefit of
providing errorRef in AsyncAppender rather than simply throwing an
exception when you run out of space in your ring buffer and instructing
users to utilizing FailoverAppender for failover functionality?

Pedro Pedruzzi | 9 Mar 21:54 2015

Configuration don't seem to take effect on previously created Logger (Weblogic 10.3.5)


I am using log4j 1.2.14 on WebLogic 10.3.5 application server. I would
really appreciate some help to understand and debug a possible issue.

I use DOMConfigurator.configureAndWatch for configuration (called on a
weblogic ApplicationLifecycleListener postStart callback).

Most of the loggers work fine. But some of them, apparently those
created before the configureAndWatch call, stay completely silent even
after configuration. For example, the issue occurs on ServletFilters
(they are instantiated by the container during application startup).

I scanned the Category hierarchy and saw that my silent logger's
parent is the "root" with level = OFF.

If I Logger.getLogger again, I get a fine one with the expected
configuration hierarchy. If I use the Apache Commons Logging API, I
always get the silent one (I guess it is being cached).

I couldn't reproduce this problem in Java SE / unit tests. The loggers
start silent, but the configuration update them automatically.

Am I doing something conceptually wrong?

Is it expected that this "automatic reconfiguration" will work on my scenario?

How can I debug this problem further?

Thanks in advance.
(Continue reading)

lsjun | 7 Mar 11:15 2015

Help me with JDBCAppender

     I want to logging to mysql , and I find this link in apache :

     But the java code have an error in my eclipse just like this :
/        The type GenericObjectPool is not generic; it cannot be 
parameterized with arguments <PoolableConnection>/

     By the way , to solve the dependency of import , I use the next maven
/        <dependency>//
//            <version>1.5.3</version>//
//        </dependency>//
//        <dependency>//
//            <version>1.2.2.osgi</version>//
//        </dependency>/

     Can anyone help me ?  (I am a software test use selenium .So I do 
not know much about dbcp .)

     Thanks !
jeremy | 6 Mar 22:48 2015

Layout by Reference?

It would be nice if config supported by reference layout definition
(LayoutRef / Layout ref="XX") similar to the way we can use
AppenderRef/Appender ref="XX"

Why? Because often a single layout configuration is used between several
appenders (like in a failover definition) and copy-pasta configuration can
lead to unintended behavior and lost data.

Didn't see any tickets on this in jira, would you like me to open one?

Mark Lybarger | 6 Mar 15:40 2015

rolling daily logger

i'm using log4j2 for some of the filters (level and dynamic).  I want my
logs to roll based on size (this makes it easy to open in vim), but also by
date (this helps organize them and I only need 1 week of logs).

here's my current configuraiton. i'm un sure how to specify a rollover
strategy that keeps 7 days worth of files with a size based triggering

any help would be most appreciated.




    <RollingFile name=*"mlog"* fileName=
*"/home/mark/jboss-eap-6.1/standalone/log/mlog.log"* filePattern=

      <PatternLayout pattern=*"%d %-5p %X{one} %X{foo} %X{bar} %c{2} -


                <SizeBasedTriggeringPolicy size=*"50 KB"* />


(Continue reading)

Robin Jansohn | 4 Mar 13:30 2015

Parameter isLog4jAutoInitializationDisabled ignored when used alongside log4jConfiguration?

I have a working project to load an external log4j2.xml configuration file in
my webapp. But when I set the context parameter
'isLog4jAutoInitializationDisabled' to disable automatic initialization,
this parameter seems to be ignored. The debug loading messages from log4j2
appear directly after startup and not only while receiving the first
webservice request:

Here's my web.xml:


Is this designed behavior, a mistake in my configuration or a bug?

View this message in context:
Sent from the Log4j - Users mailing list archive at