logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Husby <husby...@umn.edu>
Subject log4j2 JSONLayout with AsyncLogger not outputting properties
Date Sat, 12 May 2018 00:09:22 GMT
Hello!

We are trying to run log4j 2.11.0 with a JSONLayout and async appender.  We
have set the JSONLayout properties="true" but are not getting the json
properties.  Without the async appender, we DO get the json properties.

With the default synchronous appender, the logs looks like this:
, {
  "thread" : "TFIS-EventQueue-pool-0",
  "level" : "DEBUG",
  "loggerName" : "com.leidos.atm.common.threadmonitor.ThreadMonitor",
  "message" : "Heartbeat received for EventQueue",
  "endOfBatch" : false,
  "loggerFqcn" : "org.apache.logging.log4j.spi.AbstractLogger",
  "instant" : {
    "epochSecond" : 1526081799,
    "nanoOfSecond" : 377000000
  },
  "contextMap" : { },
  "threadId" : 41,
  "threadPriority" : 5
}

But when I add -Dlog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector
then the logs look like this:
, "Heartbeat received for EventQueue"
, "Heartbeat received for EventQueue"
, "Heartbeat received for EventQueue"

even with no changes to our log4j2.xml file.  I have attached our full
log4j2.xml and also the -Dlog4j2.debug output.  Here is the appender
configuration:
<RollingFile
    name="Main"
    fileName="${logDir}/tfdm.${appname}.json.log"

filePattern="${rolloverLogDir}/tfdm.${appname}.json.log.%d{yyyy-MM-dd_HHmm}{UTC}Z.gz">
    <JsonLayout properties="true" complete="true" />
    <Policies>
        <CronTriggeringPolicy schedule="${cronRolloverSchedule}" />
    </Policies>
</RollingFile>

I would greatly appreciate any insight on this issue!  Thank you in advance!

~ Joe ~

Mime
View raw message