logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mahesh Dilhan <mail.mahesh...@gmail.com>
Subject Log4j2 - JConsole JMX appender
Date Tue, 29 Oct 2013 00:58:54 GMT
Hi All,

i'm interested in learning on JMX monitoring in log4j2.

As explained I was able to get the log4j2 'tab' > statusLogger child tab in
JConsole with the initial logging statements.

Note:version : 2.0.9beta


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

<!-- No need to set system property "Log4jContextSelector" to any value
     when using <asyncLogger> or <asyncRoot>. -->

<Configuration status="debug">
    <!-- Async Loggers will auto-flush in batches, so switch off
immediateFlush. -->
    <RandomAccessFile name="RandomAccessFile"
              immediateFlush="false" append="false">
        <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>

  <Loggers >
    <!-- pattern layout actually uses location, so we need to include it -->
    <AsyncLogger  name="notificationLogger" level="trace"
      <AppenderRef ref="RandomAccessFile"/>
    <Root level="debug" includeLocation="true">
      <AppenderRef ref="notificationLogger"/>

<!-- notificationLogger -->
private static Logger logger = LogManager.getLogger("notificationLogger");

When web Application(java/servlet/spring) runs I can see the
file[asyncWithLocation.log] get appended with the logging statements,
I like to see Jconsole get appended too, But It did not.

I wonder, what configuration I should use to enable jmx logging, so that I
can see them in JConsole?

is there any documentation other than this

it would be great if above documentation is updated with a sample of
log4j2.xml configuration.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message