Melissa Warnkin | 11 Feb 19:23 2016

ApacheCon NA 2016 - Important Dates!!!

 Hello everyone!
I hope this email finds you well.  I hope everyone is as excited about ApacheCon as I am!
I'd like to remind you all of a couple of important dates, as well as ask for your assistance in spreading the
word! Please use your social media platform(s) to get the word out! The more visibility, the better
ApacheCon will be for all!! :)
CFP Close: February 12, 2016CFP Notifications: February 29, 2016Schedule Announced: March 3, 2016
To submit a talk, please visit:

Link to the main site can be found here:

Apache: Big Data North America 2016 Registration Fees:
Attendee Registration Fee: US$599 through March 6, US$799 through April 10, US$999
thereafterCommitter Registration Fee: US$275 through April 10, US$375 thereafterStudent
Registration Fee: US$275 through April 10, $375 thereafter
Planning to attend ApacheCon North America 2016 May 11 - 13, 2016? There is an add-on option on the
registration form to join the conference for a discounted fee of US$399, available only to Apache: Big
Data North America attendees.
So, please tweet away!!
I look forward to seeing you in Vancouver! Have a groovy day!!
~Melissaon behalf of the ApacheCon Team

Chris Nauroth | 10 Feb 22:20 2016

Log4J 2 configuration: parameterizing appender via environment variable

Hello Log4J community,

I'm currently investigating possible migration from Log4J 1 to Log4J 2 for
Apache ZooKeeper.  For full context, please see Apache JIRA issue
ZOOKEEPER-2342 [1].  I'm struggling with how to preserve one particular
capability that we have already given to administrators for controlling
their logging settings.  I can't find a way to achieve the same thing in
Log4J 2, and I'd like to get your advice.

The ZooKeeper launch scripts support controlling the root logger by
setting an environment variable named ZOO_LOG4J_PROP.  The value gets
passed to the launched process as a -Dzookeeper.root.logger argument [2]:

"-Dzookeeper.log.dir=${ZOO_LOG_DIR}" \
"-Dzookeeper.root.logger=${ZOO_LOG4J_PROP}" \
    -XX:+HeapDumpOnOutOfMemoryError -XX:OnOutOfMemoryError='kill -9 %p' \
2>&1 < /dev/null &

We have a Log4J 1 file that includes a default value for
zookeeper.root.logger in case it is unspecified at process launch, and
then the variable gets substituted into the declaration of
log4j.rootLogger [3]:

zookeeper.root.logger=INFO, CONSOLE

(Continue reading)

Tara Czutno | 9 Feb 02:00 2016

Errors with FlumeAppender

I am trying out Flume, but I am getting an error:
2016-02-08 17:52:46,368 main DEBUG Shutdown hook enabled. Registering a new
2016-02-08 17:52:46,370 main DEBUG LoggerContext[name=504bae78,
org.apache.logging.log4j.core.LoggerContext <at> 5824a83d] started OK.
2016-02-08 17:52:46,388 main ERROR Recursive call to appender flume
2016-02-08 17:52:46,394 main ERROR Recursive call to appender flume
2016-02-08 17:52:46,464 main ERROR Recursive call to appender flume
2016-02-08 17:52:46,464 main ERROR Recursive call to appender flume

Flume output:

2016-02-08 17:46:51,334 (conf-file-poller-0) [DEBUG -
Post validation configuration for agent

AgentConfiguration created without Configuration stubs for which only basic
syntactical validation was performed[agent]

SOURCES: {avroSrc={ parameters:{bind=localhost, channels=memoryChannel,
port=8800, type=avro} }}

CHANNELS: {memoryChannel={ parameters:{type=memory, capacity=100} }}

AgentConfiguration created with Configuration stubs for which full
validation was performed[agent]

SINKS: {loggerSink=ComponentConfiguration[loggerSink]

(Continue reading)

Tara Czutno | 8 Feb 21:16 2016

Fastest Log4j2 configuration for multiple java process / multiple machine production environment

We have 4 java processes running on machine01, 1 java process on machine02,
2 java processes on machine03.  We would like them to all write logging to
the same file on machine01.  What is the best config to accomplish
this?  We need production grade very fast high throughput logging.

Right now we have a 5th process on machine01, ecplogger, that runs the
UdpSocketServer and uses RollingRandomAccessFile Appender wrapped with
Failover Appender.  All other processes on machine01, machine02 and
machine03 write to a Socket Appender wrapped with an Async appender wrapped
with a Failover Appender.

It works sort of, however I get these errors in the main java process on
machine01 and I get lots of logging to the Failover appender:

2016-02-05 18:23:06,123 AsyncAppender-local_process_async ERROR Unable to
write to stream UDP:ecplogger:6000 for appender local_process_socket

2016-02-05 18:34:50,746 AsyncAppender-local_process_async ERROR Unable to
write to stream UDP:ecplogger:6000 for appender local_process_socket

2016-02-05 18:47:25,233 Log4j2-AsyncLogger[AsyncContext <at> 18b4aac2]1 ERROR
Appender local_process_async is unable to write primary appenders. queue is

2016-02-05 18:47:25,234 Log4j2-AsyncLogger[AsyncContext <at> 18b4aac2]1 ERROR
Appender local_process_async is unable to write primary appenders. queue is

2016-02-05 18:47:25,235 Log4j2-AsyncLogger[AsyncContext <at> 18b4aac2]1 ERROR
Appender local_process_async is unable to write primary appenders. queue is
(Continue reading)

Gary Gregory | 8 Feb 18:17 2016

New traceEntry code

Hi All:

The pattern I've had to implement for our product is close to what this
does, but not quite, so I'd like to propose changes.

The key part is for the new traceEntry methods to return the String message
it built so I can reuse it in the traceExit() call. This is how I do it now:

public int doFoo(int a, int b) {
  final String method = traceEntry("doFoo(a=%,d, b=%,d", a, b);
  // do Foo impl
  int result = ...
  return traceExit(method, result);

This allows the Entry/Exit log events to match nicely, especially in our
multi-threaded use cases. It's easier to tell which exit matches which
entry. You do not want to compute the method String more than once of

(I use the String.format() message factory to get nice looking numbers, and
so on. We allow that to be set up at the logger level, which is nice.)

I've had to cookup my own my own traceEntry/traceExit, otherwise the code
would be logger.traceEntry(...).

The verbiage I use is also different: I use a verb: "Enter", as opposed to
the noun "entry", which looks really weird in English to me. "Entry
methodName"? That does not sound good to me "Entry of methodName" OK. For
me it's "Enter methodName..." and "Exit methodName". Sentences start with a
(Continue reading)

Apostolis Giannakidis | 4 Feb 16:07 2016

Testing TimeBasedTriggeringPolicy behavior

Hello all,

My Logger uses a RollingFileAppender with a TimeBasedTriggeringPolicy.

The file pattern is set to:

I would like to write automated functional tests that use the logger and
verify that the rolling of the file is performed according to the expected
behavior of the TimeBasedTriggeringPolicy.

In other words, I'd like to write a system test that does something like
the following:
1) start the system (assuming that the current date is 2016-02-4)
2) log a message. This message will be written to logfile.log.
3) Verify that the message was logged to logfile.log.
4) Force the log file to rotate.
5) Verify that the file logfile.log.2016-02-05 was created with the correct
6) log a message. This message will be written to logfile.log.
7) Verify that the message was logged to logfile.log.

Is there any way that I could perform step #4?

One way that I was thinking of is if I could use my own implementation of
the LogEvent that would return a fake event time for each event.

What are your thoughts?

Thank you very much.
(Continue reading)

Nipuni Piyabasi Perera | 3 Feb 14:07 2016

Custom appender not identified in OSGi environment


I have written a custom appender extending the log4j2 AbstractAppender. But
I am getting a runtime error[1]. I have added the plugin annotation[2] as
per the manual and the custom appender class contains factory method
createAppender() as well. I also have added the package name to
configuration element.
What am I missing here? Appreciate any input on this.

I have my log4j2.xml file as below:

<Configuration packages="">
        <Socket name="socket" host="localhost" port="4714">
      <!--PatternLayout pattern="[%d] %5p {%c} - %m%ex%n"/-->
        <HTTPSocket name="HTTP_APPENDER" host="localhost" port="8888">
New Appender
        <Root level="info" includeLocation="true">
            <AppenderRef ref="HTTP_APPENDER"/>
        <Logger name="my.custom.deployer" level="info" additivity="true">
                <AppenderRef ref="socket"/>
(Continue reading)

Veit Guna | 3 Feb 09:47 2016

RollingRandomAccessFile and emtpy log file


I'm using log4j 2.5 with the RollingRandomAccessFile. When the application starts up and performs
logging, the logfile
gets created, but nothing is written to it. Only after I stop the application the content appears. I also
doublechecked the 256KB
buffer. But logging 600KB doesn't seem to trigger a write to the file. Console appender is working fine.

Any idea what I'm missing?

Here's my configuration:

--cut here--
<?xml version="1.0" encoding="UTF-8"?>

        <Property name="logsPath">${sys:app.logs:-${env:APP_LOGS:-logs}}</Property>

        <RollingRandomAccessFile name="rollingFileAppender" fileName="${logsPath}/app.log"
filePattern="${logsPath}/app-%d{yyyy-MM-dd}-%i.log" immediateFlush="false">
                <pattern>%d %-5p [%mdc{RQID}] [%c{1}] - %m%n</pattern>
                <SizeBasedTriggeringPolicy size="10 MB" />
            <DefaultRolloverStrategy max="5" />
(Continue reading)

Nipuni Piyabasi Perera | 1 Feb 14:06 2016

Customizing log messages with log4j2

Hi all,

I am working on adding some new log parameters to my log messages. I could
read that log4j2 provide the option to add new Converters without extending
PatternLayout. I have tried out a sample custom PatternConverter in my OSGi
environment. I got the error below, which is already reported in [1].
I haven't tried extending the patternLayout yet to address my requirement.
What is the recommended way with log4j2 to customize logging information?
Can we continue extending the patternLayout with log4j2 too?

2016-02-01 18:08:20,794 ERROR Unrecognized format specifier [hostname]
2016-02-01 18:08:20,794 ERROR Unrecognized conversion specifier [hostname]
starting at position 28 in conversion pattern.




Nipuni Perera
Software Engineer; WSO2 Inc.;
Email: nipuni <at>
Git hub profile:
Blog :
Mobile: +94 (71) 5626680
Matt Sicker | 29 Jan 22:27 2016

Where is it documented that you can supply a Throwable in a varargs log message?

Like when you do logger.debug("{}", foo, ex). I know it's supported, but I
can't find anywhere that this is mentioned.


Matt Sicker <boards <at>>
Blaine Bergeson (bbergeson | 29 Jan 16:19 2016

Standard Out stops working

I have been using Log4j for a while now without any major problems but now I am experiencing a strange problem.  If I build a simple java app and run it from the command line, as soon as I call Configurator.initialize standard out stops working.  I called the System.out.checkError method and indeed the stream is in an error state.  I added the following property -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=TRACE and then ran again which produced the following output.  I am not sure if any of the items listed below is a problem or not.  I am using the same log4j2.xml file I have used in other projects.  When I run the project inside NetBeans everything runs fine.



Thx Blaine