You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Mahesh Dilhan <ma...@gmail.com> on 2013/10/29 01:58:54 UTC

Log4j2 - JConsole JMX appender

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

log4j2.xml

<?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">
  <Appenders>
    <!-- Async Loggers will auto-flush in batches, so switch off
immediateFlush. -->
    <RandomAccessFile name="RandomAccessFile"
fileName="asyncWithLocation.log"
              immediateFlush="false" append="false">
      <PatternLayout>
        <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
      </PatternLayout>
    </RandomAccessFile>

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

<!-- 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
http://logging.apache.org/log4j/2.x/manual/jmx.html,

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

Thanks

Mahesh

Re: Log4j2 - JConsole JMX appender

Posted by Mahesh Dilhan <ma...@gmail.com>.
Hi Scott,

Thanks  a lot ,


On Thu, Oct 31, 2013 at 10:25 AM, Scott Deboy <sc...@gmail.com> wrote:

> Actually there is already a WebLookup, which supports 'contextPath',
> 'servletContextName', etc.  See:
> http://logging.apache.org/log4j/2.x/manual/lookups.html
>
> On 10/30/13, Scott Deboy <sc...@gmail.com> wrote:
> > What might be easiest is to use separate log4j configurations for each
> > web app, specifying unique names in each web app's log4j configuration
> > file.  See http://logging.apache.org/log4j/2.x/manual/logsep.html for
> > more information.
> >
> > http://logging.apache.org/log4j/2.x/manual/webapp.html mentions that
> > the ServletContext's context name is used as the LoggerContext name,
> > but the LoggerContext name isn't exposed anywhere that I can see as
> > something you could use in the naming of your rolling file.
> >
> > You may be able to do this by implementing your own Lookup - see
> > http://logging.apache.org/log4j/2.x/manual/extending.html
> >
> > Hope that helps.
> >
> > Scott
> >
> > On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> >> Hi Scott
> >>
> >> thanks for the reply.
> >>
> >> Actually I wanted to know that how to get the
> >> *web-application-context-path
> >> dynamically, without hard-code in the log4j2.xml.*
> >> *
> >> *
> >> *Sorry for the inconvenience, if i did not make my self clear .*
> >> *
> >> *
> >> " is there a way to output log file name as :
> >> "*web-application-context-path
> >> *-date.log" ? [configuration of log4j2,xml]"
> >>
> >> Yes I did append the *"date"* by looking at RollingAppender.
> >>
> >> Thanks
> >>
> >>
> >>
> >> On Thu, Oct 31, 2013 at 6:48 AM, Scott Deboy <sc...@gmail.com>
> >> wrote:
> >>
> >>> I'm not clear myself on when an async logger is useful - I am more
> >>> familiar with the (previously existing) concept of async appenders.
> >>>
> >>> I think the documentation in this area needs to be enhanced to explain
> >>> why you would use async loggers or async appenders, particularly for
> >>> file IO.
> >>>
> >>> As for generating log files with dates, yes, you can specify your own
> >>> date-related pattern with a RollingFileAppender.  See the
> >>> documentation on RollingFileAppender and examples here:
> >>> http://logging.apache.org/log4j/2.x/manual/appenders.html
> >>>
> >>> Scott
> >>>
> >>> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> >>> > Hi Scott
> >>> >
> >>> > I already configured it , yes it works for fileAppeders.
> >>> > I have seen the perftest of async logger. will there be performance
> >>> > hit
> >>> > with fileAppender compared to async logger? I already noticed time
> >>> > taken
> >>> > for initialization process is varying for file and random access
> file.
> >>> > is
> >>> > it because of "distruptor"?
> >>> >
> >>> > is there a way to output log file name as :
> >>> > "*web-application-context-path*-date.log"
> >>> > ? [configuration of log4j2,xml]
> >>> >
> >>> > Thanks
> >>> >
> >>> >
> >>> >
> >>> >
> >>> > On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com>
> >>> wrote:
> >>> >
> >>> >> Mi Mahesh,
> >>> >>
> >>> >> If you'd like to use Chainsaw with log4j2, you need to use the
> latest
> >>> >> Chainsaw developer snapshot, available here:
> >>> >> http://people.apache.org/~sdeboy
> >>> >>
> >>> >> If you use a file appender in your log4j configuration, add the
> JmDns
> >>> >> jar to your application classpath (http://jmdns.sourceforge.net),
> and
> >>> >> update your log4j configuration as described in the documentation
> >>> >> (including specifying a URI to your log file), Chainsaw should be
> >>> >> able
> >>> >> to parse and tail your log file.
> >>> >>
> >>> >> Feel free to ask additional questions here on the user list.
> >>> >>
> >>> >> Scott
> >>> >>
> >>> >> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> >>> >> > Thanks for the clarification Remko
> >>> >> >
> >>> >> >
> >>> >> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma
> >>> >> > <re...@gmail.com>
> >>> >> wrote:
> >>> >> >
> >>> >> >> Hi Mahesh,
> >>> >> >>
> >>> >> >> Thank you for re-posting your question to the user mailing list.
> >>> >> >>
> >>> >> >> The Status Logger is a special logger used by log4j internally.
> >>> >> >> If you set it to "debug" or "trace" (by starting your config xml
> >>> >> >> file
> >>> >> >> with <Configuration
> >>> >> >> status="debug">...),
> >>> >> >> it will output things like which appenders and loggers were
> >>> >> >> initialized,
> >>> >> >> which log4j plugins were found, etc.
> >>> >> >> Any configuration problems will show up in the status log.
> >>> >> >> The status log output will appear on the console (System.out).
> >>> >> >>
> >>> >> >> In JConsole, this internal logging is what you see in the
> >>> StatusLogger
> >>> >> >> tab.
> >>> >> >>
> >>> >> >> I'm guessing from your question that you would like to see the
> log
> >>> >> >> statements produced by your application in the JConsole viewer.
> >>> >> >> Unfortunately, JMX currently does not provide a way to show the
> >>> >> >> content
> >>> >> >> of
> >>> >> >> application log files.
> >>> >> >>
> >>> >> >> If you are looking for a tool that allows you to view the log
> file
> >>> >> >> from
> >>> >> a
> >>> >> >> remote machine you may want to take a look at Chainsaw.
> >>> >> >> http://logging.apache.org/chainsaw/
> >>> >> >>
> >>> >> >> Scott Deboy has been doing work to make Chainsaw's zeroconf
> >>> >> >> feature
> >>> >> >> work
> >>> >> >> well with log4j2.
> >>> >> >> I am not that familiar with Chainsaw, but perhaps this
> >>> >> >> documentation
> >>> >> >> can
> >>> >> >> get you started:
> >>> >> >>
> >>> >> >>
> >>> >>
> >>>
> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
> >>> >> >>
> >>> >> >> Best regards,
> >>> >> >> Remko
> >>> >> >>
> >>> >> >>
> >>> >> >>
> >>> >> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
> >>> >> mail.mahesh.lk@gmail.com
> >>> >> >> >wrote:
> >>> >> >>
> >>> >> >> > 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
> >>> >> >> >
> >>> >> >> > log4j2.xml
> >>> >> >> >
> >>> >> >> > <?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">
> >>> >> >> >   <Appenders>
> >>> >> >> >     <!-- Async Loggers will auto-flush in batches, so switch
> off
> >>> >> >> > immediateFlush. -->
> >>> >> >> >     <RandomAccessFile name="RandomAccessFile"
> >>> >> >> > fileName="asyncWithLocation.log"
> >>> >> >> >               immediateFlush="false" append="false">
> >>> >> >> >       <PatternLayout>
> >>> >> >> >         <Pattern>%d %p %class{1.} [%t] %location %m
> >>> >> >> > %ex%n</Pattern>
> >>> >> >> >       </PatternLayout>
> >>> >> >> >     </RandomAccessFile>
> >>> >> >> >
> >>> >> >> >   </Appenders>
> >>> >> >> >   <Loggers >
> >>> >> >> >     <!-- pattern layout actually uses location, so we need to
> >>> >> >> > include
> >>> >> >> > it
> >>> >> >> > -->
> >>> >> >> >     <AsyncLogger  name="notificationLogger" level="trace"
> >>> >> >> > includeLocation="true">
> >>> >> >> >       <AppenderRef ref="RandomAccessFile"/>
> >>> >> >> >     </AsyncLogger>
> >>> >> >> >     <Root level="debug" includeLocation="true">
> >>> >> >> >       <AppenderRef ref="notificationLogger"/>
> >>> >> >> >     </Root>
> >>> >> >> >   </Loggers>
> >>> >> >> > </Configuration>
> >>> >> >> >
> >>> >> >> > <!-- 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
> >>> >> >> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
> >>> >> >> >
> >>> >> >> > it would be great if above documentation is updated with a
> >>> >> >> > sample
> >>> of
> >>> >> >> > log4j2.xml configuration.
> >>> >> >> >
> >>> >> >> > Thanks
> >>> >> >> >
> >>> >> >> > Mahesh
> >>> >> >> >
> >>> >> >>
> >>> >> >
> >>> >> >
> >>> >> >
> >>> >> > Mahesh
> >>> >> >
> >>> >>
> >>> >>
> ---------------------------------------------------------------------
> >>> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >>> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>> >>
> >>> >>
> >>> >
> >>> >
> >>> > --
> >>> > Mahesh
> >>> >
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >>> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>>
> >>>
> >>
> >>
> >> --
> >> Mahesh
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Mahesh

Re: Log4j2 - JConsole JMX appender

Posted by Scott Deboy <sc...@gmail.com>.
Actually there is already a WebLookup, which supports 'contextPath',
'servletContextName', etc.  See:
http://logging.apache.org/log4j/2.x/manual/lookups.html

On 10/30/13, Scott Deboy <sc...@gmail.com> wrote:
> What might be easiest is to use separate log4j configurations for each
> web app, specifying unique names in each web app's log4j configuration
> file.  See http://logging.apache.org/log4j/2.x/manual/logsep.html for
> more information.
>
> http://logging.apache.org/log4j/2.x/manual/webapp.html mentions that
> the ServletContext's context name is used as the LoggerContext name,
> but the LoggerContext name isn't exposed anywhere that I can see as
> something you could use in the naming of your rolling file.
>
> You may be able to do this by implementing your own Lookup - see
> http://logging.apache.org/log4j/2.x/manual/extending.html
>
> Hope that helps.
>
> Scott
>
> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>> Hi Scott
>>
>> thanks for the reply.
>>
>> Actually I wanted to know that how to get the
>> *web-application-context-path
>> dynamically, without hard-code in the log4j2.xml.*
>> *
>> *
>> *Sorry for the inconvenience, if i did not make my self clear .*
>> *
>> *
>> " is there a way to output log file name as :
>> "*web-application-context-path
>> *-date.log" ? [configuration of log4j2,xml]"
>>
>> Yes I did append the *"date"* by looking at RollingAppender.
>>
>> Thanks
>>
>>
>>
>> On Thu, Oct 31, 2013 at 6:48 AM, Scott Deboy <sc...@gmail.com>
>> wrote:
>>
>>> I'm not clear myself on when an async logger is useful - I am more
>>> familiar with the (previously existing) concept of async appenders.
>>>
>>> I think the documentation in this area needs to be enhanced to explain
>>> why you would use async loggers or async appenders, particularly for
>>> file IO.
>>>
>>> As for generating log files with dates, yes, you can specify your own
>>> date-related pattern with a RollingFileAppender.  See the
>>> documentation on RollingFileAppender and examples here:
>>> http://logging.apache.org/log4j/2.x/manual/appenders.html
>>>
>>> Scott
>>>
>>> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>>> > Hi Scott
>>> >
>>> > I already configured it , yes it works for fileAppeders.
>>> > I have seen the perftest of async logger. will there be performance
>>> > hit
>>> > with fileAppender compared to async logger? I already noticed time
>>> > taken
>>> > for initialization process is varying for file and random access file.
>>> > is
>>> > it because of "distruptor"?
>>> >
>>> > is there a way to output log file name as :
>>> > "*web-application-context-path*-date.log"
>>> > ? [configuration of log4j2,xml]
>>> >
>>> > Thanks
>>> >
>>> >
>>> >
>>> >
>>> > On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com>
>>> wrote:
>>> >
>>> >> Mi Mahesh,
>>> >>
>>> >> If you'd like to use Chainsaw with log4j2, you need to use the latest
>>> >> Chainsaw developer snapshot, available here:
>>> >> http://people.apache.org/~sdeboy
>>> >>
>>> >> If you use a file appender in your log4j configuration, add the JmDns
>>> >> jar to your application classpath (http://jmdns.sourceforge.net), and
>>> >> update your log4j configuration as described in the documentation
>>> >> (including specifying a URI to your log file), Chainsaw should be
>>> >> able
>>> >> to parse and tail your log file.
>>> >>
>>> >> Feel free to ask additional questions here on the user list.
>>> >>
>>> >> Scott
>>> >>
>>> >> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>>> >> > Thanks for the clarification Remko
>>> >> >
>>> >> >
>>> >> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma
>>> >> > <re...@gmail.com>
>>> >> wrote:
>>> >> >
>>> >> >> Hi Mahesh,
>>> >> >>
>>> >> >> Thank you for re-posting your question to the user mailing list.
>>> >> >>
>>> >> >> The Status Logger is a special logger used by log4j internally.
>>> >> >> If you set it to "debug" or "trace" (by starting your config xml
>>> >> >> file
>>> >> >> with <Configuration
>>> >> >> status="debug">...),
>>> >> >> it will output things like which appenders and loggers were
>>> >> >> initialized,
>>> >> >> which log4j plugins were found, etc.
>>> >> >> Any configuration problems will show up in the status log.
>>> >> >> The status log output will appear on the console (System.out).
>>> >> >>
>>> >> >> In JConsole, this internal logging is what you see in the
>>> StatusLogger
>>> >> >> tab.
>>> >> >>
>>> >> >> I'm guessing from your question that you would like to see the log
>>> >> >> statements produced by your application in the JConsole viewer.
>>> >> >> Unfortunately, JMX currently does not provide a way to show the
>>> >> >> content
>>> >> >> of
>>> >> >> application log files.
>>> >> >>
>>> >> >> If you are looking for a tool that allows you to view the log file
>>> >> >> from
>>> >> a
>>> >> >> remote machine you may want to take a look at Chainsaw.
>>> >> >> http://logging.apache.org/chainsaw/
>>> >> >>
>>> >> >> Scott Deboy has been doing work to make Chainsaw's zeroconf
>>> >> >> feature
>>> >> >> work
>>> >> >> well with log4j2.
>>> >> >> I am not that familiar with Chainsaw, but perhaps this
>>> >> >> documentation
>>> >> >> can
>>> >> >> get you started:
>>> >> >>
>>> >> >>
>>> >>
>>> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
>>> >> >>
>>> >> >> Best regards,
>>> >> >> Remko
>>> >> >>
>>> >> >>
>>> >> >>
>>> >> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
>>> >> mail.mahesh.lk@gmail.com
>>> >> >> >wrote:
>>> >> >>
>>> >> >> > 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
>>> >> >> >
>>> >> >> > log4j2.xml
>>> >> >> >
>>> >> >> > <?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">
>>> >> >> >   <Appenders>
>>> >> >> >     <!-- Async Loggers will auto-flush in batches, so switch off
>>> >> >> > immediateFlush. -->
>>> >> >> >     <RandomAccessFile name="RandomAccessFile"
>>> >> >> > fileName="asyncWithLocation.log"
>>> >> >> >               immediateFlush="false" append="false">
>>> >> >> >       <PatternLayout>
>>> >> >> >         <Pattern>%d %p %class{1.} [%t] %location %m
>>> >> >> > %ex%n</Pattern>
>>> >> >> >       </PatternLayout>
>>> >> >> >     </RandomAccessFile>
>>> >> >> >
>>> >> >> >   </Appenders>
>>> >> >> >   <Loggers >
>>> >> >> >     <!-- pattern layout actually uses location, so we need to
>>> >> >> > include
>>> >> >> > it
>>> >> >> > -->
>>> >> >> >     <AsyncLogger  name="notificationLogger" level="trace"
>>> >> >> > includeLocation="true">
>>> >> >> >       <AppenderRef ref="RandomAccessFile"/>
>>> >> >> >     </AsyncLogger>
>>> >> >> >     <Root level="debug" includeLocation="true">
>>> >> >> >       <AppenderRef ref="notificationLogger"/>
>>> >> >> >     </Root>
>>> >> >> >   </Loggers>
>>> >> >> > </Configuration>
>>> >> >> >
>>> >> >> > <!-- 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
>>> >> >> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
>>> >> >> >
>>> >> >> > it would be great if above documentation is updated with a
>>> >> >> > sample
>>> of
>>> >> >> > log4j2.xml configuration.
>>> >> >> >
>>> >> >> > Thanks
>>> >> >> >
>>> >> >> > Mahesh
>>> >> >> >
>>> >> >>
>>> >> >
>>> >> >
>>> >> >
>>> >> > Mahesh
>>> >> >
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > Mahesh
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>>
>>>
>>
>>
>> --
>> Mahesh
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 - JConsole JMX appender

Posted by Scott Deboy <sc...@gmail.com>.
What might be easiest is to use separate log4j configurations for each
web app, specifying unique names in each web app's log4j configuration
file.  See http://logging.apache.org/log4j/2.x/manual/logsep.html for
more information.

http://logging.apache.org/log4j/2.x/manual/webapp.html mentions that
the ServletContext's context name is used as the LoggerContext name,
but the LoggerContext name isn't exposed anywhere that I can see as
something you could use in the naming of your rolling file.

You may be able to do this by implementing your own Lookup - see
http://logging.apache.org/log4j/2.x/manual/extending.html

Hope that helps.

Scott

On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> Hi Scott
>
> thanks for the reply.
>
> Actually I wanted to know that how to get the *web-application-context-path
> dynamically, without hard-code in the log4j2.xml.*
> *
> *
> *Sorry for the inconvenience, if i did not make my self clear .*
> *
> *
> " is there a way to output log file name as :
> "*web-application-context-path
> *-date.log" ? [configuration of log4j2,xml]"
>
> Yes I did append the *"date"* by looking at RollingAppender.
>
> Thanks
>
>
>
> On Thu, Oct 31, 2013 at 6:48 AM, Scott Deboy <sc...@gmail.com> wrote:
>
>> I'm not clear myself on when an async logger is useful - I am more
>> familiar with the (previously existing) concept of async appenders.
>>
>> I think the documentation in this area needs to be enhanced to explain
>> why you would use async loggers or async appenders, particularly for
>> file IO.
>>
>> As for generating log files with dates, yes, you can specify your own
>> date-related pattern with a RollingFileAppender.  See the
>> documentation on RollingFileAppender and examples here:
>> http://logging.apache.org/log4j/2.x/manual/appenders.html
>>
>> Scott
>>
>> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>> > Hi Scott
>> >
>> > I already configured it , yes it works for fileAppeders.
>> > I have seen the perftest of async logger. will there be performance hit
>> > with fileAppender compared to async logger? I already noticed time
>> > taken
>> > for initialization process is varying for file and random access file.
>> > is
>> > it because of "distruptor"?
>> >
>> > is there a way to output log file name as :
>> > "*web-application-context-path*-date.log"
>> > ? [configuration of log4j2,xml]
>> >
>> > Thanks
>> >
>> >
>> >
>> >
>> > On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com>
>> wrote:
>> >
>> >> Mi Mahesh,
>> >>
>> >> If you'd like to use Chainsaw with log4j2, you need to use the latest
>> >> Chainsaw developer snapshot, available here:
>> >> http://people.apache.org/~sdeboy
>> >>
>> >> If you use a file appender in your log4j configuration, add the JmDns
>> >> jar to your application classpath (http://jmdns.sourceforge.net), and
>> >> update your log4j configuration as described in the documentation
>> >> (including specifying a URI to your log file), Chainsaw should be able
>> >> to parse and tail your log file.
>> >>
>> >> Feel free to ask additional questions here on the user list.
>> >>
>> >> Scott
>> >>
>> >> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>> >> > Thanks for the clarification Remko
>> >> >
>> >> >
>> >> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com>
>> >> wrote:
>> >> >
>> >> >> Hi Mahesh,
>> >> >>
>> >> >> Thank you for re-posting your question to the user mailing list.
>> >> >>
>> >> >> The Status Logger is a special logger used by log4j internally.
>> >> >> If you set it to "debug" or "trace" (by starting your config xml
>> >> >> file
>> >> >> with <Configuration
>> >> >> status="debug">...),
>> >> >> it will output things like which appenders and loggers were
>> >> >> initialized,
>> >> >> which log4j plugins were found, etc.
>> >> >> Any configuration problems will show up in the status log.
>> >> >> The status log output will appear on the console (System.out).
>> >> >>
>> >> >> In JConsole, this internal logging is what you see in the
>> StatusLogger
>> >> >> tab.
>> >> >>
>> >> >> I'm guessing from your question that you would like to see the log
>> >> >> statements produced by your application in the JConsole viewer.
>> >> >> Unfortunately, JMX currently does not provide a way to show the
>> >> >> content
>> >> >> of
>> >> >> application log files.
>> >> >>
>> >> >> If you are looking for a tool that allows you to view the log file
>> >> >> from
>> >> a
>> >> >> remote machine you may want to take a look at Chainsaw.
>> >> >> http://logging.apache.org/chainsaw/
>> >> >>
>> >> >> Scott Deboy has been doing work to make Chainsaw's zeroconf feature
>> >> >> work
>> >> >> well with log4j2.
>> >> >> I am not that familiar with Chainsaw, but perhaps this
>> >> >> documentation
>> >> >> can
>> >> >> get you started:
>> >> >>
>> >> >>
>> >>
>> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
>> >> >>
>> >> >> Best regards,
>> >> >> Remko
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
>> >> mail.mahesh.lk@gmail.com
>> >> >> >wrote:
>> >> >>
>> >> >> > 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
>> >> >> >
>> >> >> > log4j2.xml
>> >> >> >
>> >> >> > <?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">
>> >> >> >   <Appenders>
>> >> >> >     <!-- Async Loggers will auto-flush in batches, so switch off
>> >> >> > immediateFlush. -->
>> >> >> >     <RandomAccessFile name="RandomAccessFile"
>> >> >> > fileName="asyncWithLocation.log"
>> >> >> >               immediateFlush="false" append="false">
>> >> >> >       <PatternLayout>
>> >> >> >         <Pattern>%d %p %class{1.} [%t] %location %m
>> >> >> > %ex%n</Pattern>
>> >> >> >       </PatternLayout>
>> >> >> >     </RandomAccessFile>
>> >> >> >
>> >> >> >   </Appenders>
>> >> >> >   <Loggers >
>> >> >> >     <!-- pattern layout actually uses location, so we need to
>> >> >> > include
>> >> >> > it
>> >> >> > -->
>> >> >> >     <AsyncLogger  name="notificationLogger" level="trace"
>> >> >> > includeLocation="true">
>> >> >> >       <AppenderRef ref="RandomAccessFile"/>
>> >> >> >     </AsyncLogger>
>> >> >> >     <Root level="debug" includeLocation="true">
>> >> >> >       <AppenderRef ref="notificationLogger"/>
>> >> >> >     </Root>
>> >> >> >   </Loggers>
>> >> >> > </Configuration>
>> >> >> >
>> >> >> > <!-- 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
>> >> >> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
>> >> >> >
>> >> >> > it would be great if above documentation is updated with a sample
>> of
>> >> >> > log4j2.xml configuration.
>> >> >> >
>> >> >> > Thanks
>> >> >> >
>> >> >> > Mahesh
>> >> >> >
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> > Mahesh
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
>> >>
>> >>
>> >
>> >
>> > --
>> > Mahesh
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>
>
> --
> Mahesh
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 - JConsole JMX appender

Posted by Mahesh Dilhan <ma...@gmail.com>.
Hi Scott

thanks for the reply.

Actually I wanted to know that how to get the *web-application-context-path
dynamically, without hard-code in the log4j2.xml.*
*
*
*Sorry for the inconvenience, if i did not make my self clear .*
*
*
" is there a way to output log file name as : "*web-application-context-path
*-date.log" ? [configuration of log4j2,xml]"

Yes I did append the *"date"* by looking at RollingAppender.

Thanks



On Thu, Oct 31, 2013 at 6:48 AM, Scott Deboy <sc...@gmail.com> wrote:

> I'm not clear myself on when an async logger is useful - I am more
> familiar with the (previously existing) concept of async appenders.
>
> I think the documentation in this area needs to be enhanced to explain
> why you would use async loggers or async appenders, particularly for
> file IO.
>
> As for generating log files with dates, yes, you can specify your own
> date-related pattern with a RollingFileAppender.  See the
> documentation on RollingFileAppender and examples here:
> http://logging.apache.org/log4j/2.x/manual/appenders.html
>
> Scott
>
> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> > Hi Scott
> >
> > I already configured it , yes it works for fileAppeders.
> > I have seen the perftest of async logger. will there be performance hit
> > with fileAppender compared to async logger? I already noticed time taken
> > for initialization process is varying for file and random access file. is
> > it because of "distruptor"?
> >
> > is there a way to output log file name as :
> > "*web-application-context-path*-date.log"
> > ? [configuration of log4j2,xml]
> >
> > Thanks
> >
> >
> >
> >
> > On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com>
> wrote:
> >
> >> Mi Mahesh,
> >>
> >> If you'd like to use Chainsaw with log4j2, you need to use the latest
> >> Chainsaw developer snapshot, available here:
> >> http://people.apache.org/~sdeboy
> >>
> >> If you use a file appender in your log4j configuration, add the JmDns
> >> jar to your application classpath (http://jmdns.sourceforge.net), and
> >> update your log4j configuration as described in the documentation
> >> (including specifying a URI to your log file), Chainsaw should be able
> >> to parse and tail your log file.
> >>
> >> Feel free to ask additional questions here on the user list.
> >>
> >> Scott
> >>
> >> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> >> > Thanks for the clarification Remko
> >> >
> >> >
> >> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com>
> >> wrote:
> >> >
> >> >> Hi Mahesh,
> >> >>
> >> >> Thank you for re-posting your question to the user mailing list.
> >> >>
> >> >> The Status Logger is a special logger used by log4j internally.
> >> >> If you set it to "debug" or "trace" (by starting your config xml file
> >> >> with <Configuration
> >> >> status="debug">...),
> >> >> it will output things like which appenders and loggers were
> >> >> initialized,
> >> >> which log4j plugins were found, etc.
> >> >> Any configuration problems will show up in the status log.
> >> >> The status log output will appear on the console (System.out).
> >> >>
> >> >> In JConsole, this internal logging is what you see in the
> StatusLogger
> >> >> tab.
> >> >>
> >> >> I'm guessing from your question that you would like to see the log
> >> >> statements produced by your application in the JConsole viewer.
> >> >> Unfortunately, JMX currently does not provide a way to show the
> >> >> content
> >> >> of
> >> >> application log files.
> >> >>
> >> >> If you are looking for a tool that allows you to view the log file
> >> >> from
> >> a
> >> >> remote machine you may want to take a look at Chainsaw.
> >> >> http://logging.apache.org/chainsaw/
> >> >>
> >> >> Scott Deboy has been doing work to make Chainsaw's zeroconf feature
> >> >> work
> >> >> well with log4j2.
> >> >> I am not that familiar with Chainsaw, but perhaps this documentation
> >> >> can
> >> >> get you started:
> >> >>
> >> >>
> >>
> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
> >> >>
> >> >> Best regards,
> >> >> Remko
> >> >>
> >> >>
> >> >>
> >> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
> >> mail.mahesh.lk@gmail.com
> >> >> >wrote:
> >> >>
> >> >> > 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
> >> >> >
> >> >> > log4j2.xml
> >> >> >
> >> >> > <?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">
> >> >> >   <Appenders>
> >> >> >     <!-- Async Loggers will auto-flush in batches, so switch off
> >> >> > immediateFlush. -->
> >> >> >     <RandomAccessFile name="RandomAccessFile"
> >> >> > fileName="asyncWithLocation.log"
> >> >> >               immediateFlush="false" append="false">
> >> >> >       <PatternLayout>
> >> >> >         <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
> >> >> >       </PatternLayout>
> >> >> >     </RandomAccessFile>
> >> >> >
> >> >> >   </Appenders>
> >> >> >   <Loggers >
> >> >> >     <!-- pattern layout actually uses location, so we need to
> >> >> > include
> >> >> > it
> >> >> > -->
> >> >> >     <AsyncLogger  name="notificationLogger" level="trace"
> >> >> > includeLocation="true">
> >> >> >       <AppenderRef ref="RandomAccessFile"/>
> >> >> >     </AsyncLogger>
> >> >> >     <Root level="debug" includeLocation="true">
> >> >> >       <AppenderRef ref="notificationLogger"/>
> >> >> >     </Root>
> >> >> >   </Loggers>
> >> >> > </Configuration>
> >> >> >
> >> >> > <!-- 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
> >> >> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
> >> >> >
> >> >> > it would be great if above documentation is updated with a sample
> of
> >> >> > log4j2.xml configuration.
> >> >> >
> >> >> > Thanks
> >> >> >
> >> >> > Mahesh
> >> >> >
> >> >>
> >> >
> >> >
> >> >
> >> > Mahesh
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> >> For additional commands, e-mail: log4j-user-help@logging.apache.org
> >>
> >>
> >
> >
> > --
> > Mahesh
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Mahesh

Re: Log4j2 - JConsole JMX appender

Posted by Scott Deboy <sc...@gmail.com>.
The page makes it clear that async loggers provide a clear
throughput/latency advantage over async appenders...but.

If folks use both async appenders and async loggers, won't that
actually increase latency over just using async loggers?  Then use all
of that with random access file appenders..and folks are actually
shooting themselves in the foot.

That's mostly what I'm talking about.

Makes me wonder if we really need two mechanisms - can we get by with
one? or is the problem that you have to define at the logger level,
which is a pain?

Scott

On 10/30/13, Remko Popma <re...@gmail.com> wrote:
> Async loggers use the LMAX disruptor to remove lock contention when many
> threads are logging simultaneously. This is faster than the queue used by
> AsyncAppender.
> This is all documented I think, but let me know what part of the current
> docs should be fixed.
>
> By default the disruptor ringbuffer is configured to be very large & will
> consume about 30 MB of memory. This bit can be documented better.
>
> I didn't think it mattered whether the underlying appender does file IO or
> network IO. Did I miss something?
>
> Remko
>
> On Thursday, October 31, 2013, Scott Deboy wrote:
>
>> I'm not clear myself on when an async logger is useful - I am more
>> familiar with the (previously existing) concept of async appenders.
>>
>> I think the documentation in this area needs to be enhanced to explain
>> why you would use async loggers or async appenders, particularly for
>> file IO.
>>
>> As for generating log files with dates, yes, you can specify your own
>> date-related pattern with a RollingFileAppender.  See the
>> documentation on RollingFileAppender and examples here:
>> http://logging.apache.org/log4j/2.x/manual/appenders.html
>>
>> Scott
>>
>> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>> > Hi Scott
>> >
>> > I already configured it , yes it works for fileAppeders.
>> > I have seen the perftest of async logger. will there be performance hit
>> > with fileAppender compared to async logger? I already noticed time
>> > taken
>> > for initialization process is varying for file and random access file.
>> > is
>> > it because of "distruptor"?
>> >
>> > is there a way to output log file name as :
>> > "*web-application-context-path*-date.log"
>> > ? [configuration of log4j2,xml]
>> >
>> > Thanks
>> >
>> >
>> >
>> >
>> > On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com>
>> wrote:
>> >
>> >> Mi Mahesh,
>> >>
>> >> If you'd like to use Chainsaw with log4j2, you need to use the latest
>> >> Chainsaw developer snapshot, available here:
>> >> http://people.apache.org/~sdeboy
>> >>
>> >> If you use a file appender in your log4j configuration, add the JmDns
>> >> jar to your application classpath (http://jmdns.sourceforge.net), and
>> >> update your log4j configuration as described in the documentation
>> >> (including specifying a URI to your log file), Chainsaw should be able
>> >> to parse and tail your log file.
>> >>
>> >> Feel free to ask additional questions here on the user list.
>> >>
>> >> Scott
>> >>
>> >> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>> >> > Thanks for the clarification Remko
>> >> >
>> >> >
>> >> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com>
>> >> wrote:
>> >> >
>> >> >> Hi Mahesh,
>> >> >>
>> >> >> Thank you for re-posting your question to the user mailing list.
>> >> >>
>> >> >> The Status Logger is a special logger used by log4j internally.
>> >> >> If you set it to "debug" or "trace" (by starting your config xml
>> >> >> file
>> >> >> with <Configuration
>> >> >> status="debug">...),
>> >> >> it will output things like which appenders and loggers were
>> >> >> initialized,
>> >> >> which log4j plugins were found, etc.
>> >> >> Any configuration problems will show up in the status log.
>> >> >> The status log output will appear on the console (System.out).
>> >> >>
>> >> >> In JConsole, this internal logging is what you see in the
>> StatusLogger
>> >> >> tab.
>> >> >>
>> >> >> I'm guessing from your question that you would like to see the log
>> >> >> statements produced by your application in the JConsole viewer.
>> >> >> Unfortunately, JMX currently does not provide a way to show the
>> >> >> content
>> >> >> of
>> >> >> application log files.
>> >> >>
>> >> >> If you are looking for a tool that allows you to view the log file
>> >> >> from
>> >> a
>> >> >> remote machine you may want to take a look at Chainsaw.
>> >> >> http://logging.apache.org/chainsaw/
>> >> >>
>> >> >> Scott Deboy has been doing work to make Chainsaw's zeroconf feature
>> >> >> work
>> >> >> well with log4j2.
>> >> >> I am not that familiar with Chainsaw, but perhaps this
>> >> >> documentation
>> >> >> can
>> >> >> get you started:
>> >> >>
>> >> >>
>> >>
>> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
>> >> >>
>> >> >> Best regards,
>> >> >> Remko
>> >> >>
>> >> >>
>> >> >>
>> >> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
>> >>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 - JConsole JMX appender

Posted by Remko Popma <re...@gmail.com>.
Async loggers use the LMAX disruptor to remove lock contention when many
threads are logging simultaneously. This is faster than the queue used by
AsyncAppender.
This is all documented I think, but let me know what part of the current
docs should be fixed.

By default the disruptor ringbuffer is configured to be very large & will
consume about 30 MB of memory. This bit can be documented better.

I didn't think it mattered whether the underlying appender does file IO or
network IO. Did I miss something?

Remko

On Thursday, October 31, 2013, Scott Deboy wrote:

> I'm not clear myself on when an async logger is useful - I am more
> familiar with the (previously existing) concept of async appenders.
>
> I think the documentation in this area needs to be enhanced to explain
> why you would use async loggers or async appenders, particularly for
> file IO.
>
> As for generating log files with dates, yes, you can specify your own
> date-related pattern with a RollingFileAppender.  See the
> documentation on RollingFileAppender and examples here:
> http://logging.apache.org/log4j/2.x/manual/appenders.html
>
> Scott
>
> On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> > Hi Scott
> >
> > I already configured it , yes it works for fileAppeders.
> > I have seen the perftest of async logger. will there be performance hit
> > with fileAppender compared to async logger? I already noticed time taken
> > for initialization process is varying for file and random access file. is
> > it because of "distruptor"?
> >
> > is there a way to output log file name as :
> > "*web-application-context-path*-date.log"
> > ? [configuration of log4j2,xml]
> >
> > Thanks
> >
> >
> >
> >
> > On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com>
> wrote:
> >
> >> Mi Mahesh,
> >>
> >> If you'd like to use Chainsaw with log4j2, you need to use the latest
> >> Chainsaw developer snapshot, available here:
> >> http://people.apache.org/~sdeboy
> >>
> >> If you use a file appender in your log4j configuration, add the JmDns
> >> jar to your application classpath (http://jmdns.sourceforge.net), and
> >> update your log4j configuration as described in the documentation
> >> (including specifying a URI to your log file), Chainsaw should be able
> >> to parse and tail your log file.
> >>
> >> Feel free to ask additional questions here on the user list.
> >>
> >> Scott
> >>
> >> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> >> > Thanks for the clarification Remko
> >> >
> >> >
> >> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com>
> >> wrote:
> >> >
> >> >> Hi Mahesh,
> >> >>
> >> >> Thank you for re-posting your question to the user mailing list.
> >> >>
> >> >> The Status Logger is a special logger used by log4j internally.
> >> >> If you set it to "debug" or "trace" (by starting your config xml file
> >> >> with <Configuration
> >> >> status="debug">...),
> >> >> it will output things like which appenders and loggers were
> >> >> initialized,
> >> >> which log4j plugins were found, etc.
> >> >> Any configuration problems will show up in the status log.
> >> >> The status log output will appear on the console (System.out).
> >> >>
> >> >> In JConsole, this internal logging is what you see in the
> StatusLogger
> >> >> tab.
> >> >>
> >> >> I'm guessing from your question that you would like to see the log
> >> >> statements produced by your application in the JConsole viewer.
> >> >> Unfortunately, JMX currently does not provide a way to show the
> >> >> content
> >> >> of
> >> >> application log files.
> >> >>
> >> >> If you are looking for a tool that allows you to view the log file
> >> >> from
> >> a
> >> >> remote machine you may want to take a look at Chainsaw.
> >> >> http://logging.apache.org/chainsaw/
> >> >>
> >> >> Scott Deboy has been doing work to make Chainsaw's zeroconf feature
> >> >> work
> >> >> well with log4j2.
> >> >> I am not that familiar with Chainsaw, but perhaps this documentation
> >> >> can
> >> >> get you started:
> >> >>
> >> >>
> >>
> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
> >> >>
> >> >> Best regards,
> >> >> Remko
> >> >>
> >> >>
> >> >>
> >> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
> >>

Re: Log4j2 - JConsole JMX appender

Posted by Scott Deboy <sc...@gmail.com>.
I'm not clear myself on when an async logger is useful - I am more
familiar with the (previously existing) concept of async appenders.

I think the documentation in this area needs to be enhanced to explain
why you would use async loggers or async appenders, particularly for
file IO.

As for generating log files with dates, yes, you can specify your own
date-related pattern with a RollingFileAppender.  See the
documentation on RollingFileAppender and examples here:
http://logging.apache.org/log4j/2.x/manual/appenders.html

Scott

On 10/30/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> Hi Scott
>
> I already configured it , yes it works for fileAppeders.
> I have seen the perftest of async logger. will there be performance hit
> with fileAppender compared to async logger? I already noticed time taken
> for initialization process is varying for file and random access file. is
> it because of "distruptor"?
>
> is there a way to output log file name as :
> "*web-application-context-path*-date.log"
> ? [configuration of log4j2,xml]
>
> Thanks
>
>
>
>
> On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com> wrote:
>
>> Mi Mahesh,
>>
>> If you'd like to use Chainsaw with log4j2, you need to use the latest
>> Chainsaw developer snapshot, available here:
>> http://people.apache.org/~sdeboy
>>
>> If you use a file appender in your log4j configuration, add the JmDns
>> jar to your application classpath (http://jmdns.sourceforge.net), and
>> update your log4j configuration as described in the documentation
>> (including specifying a URI to your log file), Chainsaw should be able
>> to parse and tail your log file.
>>
>> Feel free to ask additional questions here on the user list.
>>
>> Scott
>>
>> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
>> > Thanks for the clarification Remko
>> >
>> >
>> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com>
>> wrote:
>> >
>> >> Hi Mahesh,
>> >>
>> >> Thank you for re-posting your question to the user mailing list.
>> >>
>> >> The Status Logger is a special logger used by log4j internally.
>> >> If you set it to "debug" or "trace" (by starting your config xml file
>> >> with <Configuration
>> >> status="debug">...),
>> >> it will output things like which appenders and loggers were
>> >> initialized,
>> >> which log4j plugins were found, etc.
>> >> Any configuration problems will show up in the status log.
>> >> The status log output will appear on the console (System.out).
>> >>
>> >> In JConsole, this internal logging is what you see in the StatusLogger
>> >> tab.
>> >>
>> >> I'm guessing from your question that you would like to see the log
>> >> statements produced by your application in the JConsole viewer.
>> >> Unfortunately, JMX currently does not provide a way to show the
>> >> content
>> >> of
>> >> application log files.
>> >>
>> >> If you are looking for a tool that allows you to view the log file
>> >> from
>> a
>> >> remote machine you may want to take a look at Chainsaw.
>> >> http://logging.apache.org/chainsaw/
>> >>
>> >> Scott Deboy has been doing work to make Chainsaw's zeroconf feature
>> >> work
>> >> well with log4j2.
>> >> I am not that familiar with Chainsaw, but perhaps this documentation
>> >> can
>> >> get you started:
>> >>
>> >>
>> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
>> >>
>> >> Best regards,
>> >> Remko
>> >>
>> >>
>> >>
>> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
>> mail.mahesh.lk@gmail.com
>> >> >wrote:
>> >>
>> >> > 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
>> >> >
>> >> > log4j2.xml
>> >> >
>> >> > <?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">
>> >> >   <Appenders>
>> >> >     <!-- Async Loggers will auto-flush in batches, so switch off
>> >> > immediateFlush. -->
>> >> >     <RandomAccessFile name="RandomAccessFile"
>> >> > fileName="asyncWithLocation.log"
>> >> >               immediateFlush="false" append="false">
>> >> >       <PatternLayout>
>> >> >         <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
>> >> >       </PatternLayout>
>> >> >     </RandomAccessFile>
>> >> >
>> >> >   </Appenders>
>> >> >   <Loggers >
>> >> >     <!-- pattern layout actually uses location, so we need to
>> >> > include
>> >> > it
>> >> > -->
>> >> >     <AsyncLogger  name="notificationLogger" level="trace"
>> >> > includeLocation="true">
>> >> >       <AppenderRef ref="RandomAccessFile"/>
>> >> >     </AsyncLogger>
>> >> >     <Root level="debug" includeLocation="true">
>> >> >       <AppenderRef ref="notificationLogger"/>
>> >> >     </Root>
>> >> >   </Loggers>
>> >> > </Configuration>
>> >> >
>> >> > <!-- 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
>> >> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
>> >> >
>> >> > it would be great if above documentation is updated with a sample of
>> >> > log4j2.xml configuration.
>> >> >
>> >> > Thanks
>> >> >
>> >> > Mahesh
>> >> >
>> >>
>> >
>> >
>> >
>> > Mahesh
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>
>
> --
> Mahesh
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 - JConsole JMX appender

Posted by Mahesh Dilhan <ma...@gmail.com>.
Hi Scott

I already configured it , yes it works for fileAppeders.
I have seen the perftest of async logger. will there be performance hit
with fileAppender compared to async logger? I already noticed time taken
for initialization process is varying for file and random access file. is
it because of "distruptor"?

is there a way to output log file name as :
"*web-application-context-path*-date.log"
? [configuration of log4j2,xml]

Thanks




On Thu, Oct 31, 2013 at 3:16 AM, Scott Deboy <sc...@gmail.com> wrote:

> Mi Mahesh,
>
> If you'd like to use Chainsaw with log4j2, you need to use the latest
> Chainsaw developer snapshot, available here:
> http://people.apache.org/~sdeboy
>
> If you use a file appender in your log4j configuration, add the JmDns
> jar to your application classpath (http://jmdns.sourceforge.net), and
> update your log4j configuration as described in the documentation
> (including specifying a URI to your log file), Chainsaw should be able
> to parse and tail your log file.
>
> Feel free to ask additional questions here on the user list.
>
> Scott
>
> On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> > Thanks for the clarification Remko
> >
> >
> > On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com>
> wrote:
> >
> >> Hi Mahesh,
> >>
> >> Thank you for re-posting your question to the user mailing list.
> >>
> >> The Status Logger is a special logger used by log4j internally.
> >> If you set it to "debug" or "trace" (by starting your config xml file
> >> with <Configuration
> >> status="debug">...),
> >> it will output things like which appenders and loggers were initialized,
> >> which log4j plugins were found, etc.
> >> Any configuration problems will show up in the status log.
> >> The status log output will appear on the console (System.out).
> >>
> >> In JConsole, this internal logging is what you see in the StatusLogger
> >> tab.
> >>
> >> I'm guessing from your question that you would like to see the log
> >> statements produced by your application in the JConsole viewer.
> >> Unfortunately, JMX currently does not provide a way to show the content
> >> of
> >> application log files.
> >>
> >> If you are looking for a tool that allows you to view the log file from
> a
> >> remote machine you may want to take a look at Chainsaw.
> >> http://logging.apache.org/chainsaw/
> >>
> >> Scott Deboy has been doing work to make Chainsaw's zeroconf feature work
> >> well with log4j2.
> >> I am not that familiar with Chainsaw, but perhaps this documentation can
> >> get you started:
> >>
> >>
> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
> >>
> >> Best regards,
> >> Remko
> >>
> >>
> >>
> >> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <
> mail.mahesh.lk@gmail.com
> >> >wrote:
> >>
> >> > 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
> >> >
> >> > log4j2.xml
> >> >
> >> > <?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">
> >> >   <Appenders>
> >> >     <!-- Async Loggers will auto-flush in batches, so switch off
> >> > immediateFlush. -->
> >> >     <RandomAccessFile name="RandomAccessFile"
> >> > fileName="asyncWithLocation.log"
> >> >               immediateFlush="false" append="false">
> >> >       <PatternLayout>
> >> >         <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
> >> >       </PatternLayout>
> >> >     </RandomAccessFile>
> >> >
> >> >   </Appenders>
> >> >   <Loggers >
> >> >     <!-- pattern layout actually uses location, so we need to include
> >> > it
> >> > -->
> >> >     <AsyncLogger  name="notificationLogger" level="trace"
> >> > includeLocation="true">
> >> >       <AppenderRef ref="RandomAccessFile"/>
> >> >     </AsyncLogger>
> >> >     <Root level="debug" includeLocation="true">
> >> >       <AppenderRef ref="notificationLogger"/>
> >> >     </Root>
> >> >   </Loggers>
> >> > </Configuration>
> >> >
> >> > <!-- 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
> >> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
> >> >
> >> > it would be great if above documentation is updated with a sample of
> >> > log4j2.xml configuration.
> >> >
> >> > Thanks
> >> >
> >> > Mahesh
> >> >
> >>
> >
> >
> >
> > Mahesh
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
Mahesh

Re: Log4j2 - JConsole JMX appender

Posted by Scott Deboy <sc...@gmail.com>.
Mi Mahesh,

If you'd like to use Chainsaw with log4j2, you need to use the latest
Chainsaw developer snapshot, available here:
http://people.apache.org/~sdeboy

If you use a file appender in your log4j configuration, add the JmDns
jar to your application classpath (http://jmdns.sourceforge.net), and
update your log4j configuration as described in the documentation
(including specifying a URI to your log file), Chainsaw should be able
to parse and tail your log file.

Feel free to ask additional questions here on the user list.

Scott

On 10/28/13, Mahesh Dilhan <ma...@gmail.com> wrote:
> Thanks for the clarification Remko
>
>
> On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com> wrote:
>
>> Hi Mahesh,
>>
>> Thank you for re-posting your question to the user mailing list.
>>
>> The Status Logger is a special logger used by log4j internally.
>> If you set it to "debug" or "trace" (by starting your config xml file
>> with <Configuration
>> status="debug">...),
>> it will output things like which appenders and loggers were initialized,
>> which log4j plugins were found, etc.
>> Any configuration problems will show up in the status log.
>> The status log output will appear on the console (System.out).
>>
>> In JConsole, this internal logging is what you see in the StatusLogger
>> tab.
>>
>> I'm guessing from your question that you would like to see the log
>> statements produced by your application in the JConsole viewer.
>> Unfortunately, JMX currently does not provide a way to show the content
>> of
>> application log files.
>>
>> If you are looking for a tool that allows you to view the log file from a
>> remote machine you may want to take a look at Chainsaw.
>> http://logging.apache.org/chainsaw/
>>
>> Scott Deboy has been doing work to make Chainsaw's zeroconf feature work
>> well with log4j2.
>> I am not that familiar with Chainsaw, but perhaps this documentation can
>> get you started:
>>
>> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
>>
>> Best regards,
>> Remko
>>
>>
>>
>> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <mail.mahesh.lk@gmail.com
>> >wrote:
>>
>> > 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
>> >
>> > log4j2.xml
>> >
>> > <?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">
>> >   <Appenders>
>> >     <!-- Async Loggers will auto-flush in batches, so switch off
>> > immediateFlush. -->
>> >     <RandomAccessFile name="RandomAccessFile"
>> > fileName="asyncWithLocation.log"
>> >               immediateFlush="false" append="false">
>> >       <PatternLayout>
>> >         <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
>> >       </PatternLayout>
>> >     </RandomAccessFile>
>> >
>> >   </Appenders>
>> >   <Loggers >
>> >     <!-- pattern layout actually uses location, so we need to include
>> > it
>> > -->
>> >     <AsyncLogger  name="notificationLogger" level="trace"
>> > includeLocation="true">
>> >       <AppenderRef ref="RandomAccessFile"/>
>> >     </AsyncLogger>
>> >     <Root level="debug" includeLocation="true">
>> >       <AppenderRef ref="notificationLogger"/>
>> >     </Root>
>> >   </Loggers>
>> > </Configuration>
>> >
>> > <!-- 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
>> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
>> >
>> > it would be great if above documentation is updated with a sample of
>> > log4j2.xml configuration.
>> >
>> > Thanks
>> >
>> > Mahesh
>> >
>>
>
>
>
> Mahesh
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: Log4j2 - JConsole JMX appender

Posted by Mahesh Dilhan <ma...@gmail.com>.
Thanks for the clarification Remko


On Tue, Oct 29, 2013 at 8:52 AM, Remko Popma <re...@gmail.com> wrote:

> Hi Mahesh,
>
> Thank you for re-posting your question to the user mailing list.
>
> The Status Logger is a special logger used by log4j internally.
> If you set it to "debug" or "trace" (by starting your config xml file
> with <Configuration
> status="debug">...),
> it will output things like which appenders and loggers were initialized,
> which log4j plugins were found, etc.
> Any configuration problems will show up in the status log.
> The status log output will appear on the console (System.out).
>
> In JConsole, this internal logging is what you see in the StatusLogger tab.
>
> I'm guessing from your question that you would like to see the log
> statements produced by your application in the JConsole viewer.
> Unfortunately, JMX currently does not provide a way to show the content of
> application log files.
>
> If you are looking for a tool that allows you to view the log file from a
> remote machine you may want to take a look at Chainsaw.
> http://logging.apache.org/chainsaw/
>
> Scott Deboy has been doing work to make Chainsaw's zeroconf feature work
> well with log4j2.
> I am not that familiar with Chainsaw, but perhaps this documentation can
> get you started:
>
> http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations
>
> Best regards,
> Remko
>
>
>
> On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <mail.mahesh.lk@gmail.com
> >wrote:
>
> > 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
> >
> > log4j2.xml
> >
> > <?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">
> >   <Appenders>
> >     <!-- Async Loggers will auto-flush in batches, so switch off
> > immediateFlush. -->
> >     <RandomAccessFile name="RandomAccessFile"
> > fileName="asyncWithLocation.log"
> >               immediateFlush="false" append="false">
> >       <PatternLayout>
> >         <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
> >       </PatternLayout>
> >     </RandomAccessFile>
> >
> >   </Appenders>
> >   <Loggers >
> >     <!-- pattern layout actually uses location, so we need to include it
> > -->
> >     <AsyncLogger  name="notificationLogger" level="trace"
> > includeLocation="true">
> >       <AppenderRef ref="RandomAccessFile"/>
> >     </AsyncLogger>
> >     <Root level="debug" includeLocation="true">
> >       <AppenderRef ref="notificationLogger"/>
> >     </Root>
> >   </Loggers>
> > </Configuration>
> >
> > <!-- 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
> > http://logging.apache.org/log4j/2.x/manual/jmx.html,
> >
> > it would be great if above documentation is updated with a sample of
> > log4j2.xml configuration.
> >
> > Thanks
> >
> > Mahesh
> >
>



Mahesh

Re: Log4j2 - JConsole JMX appender

Posted by Remko Popma <re...@gmail.com>.
Hi Mahesh,

Thank you for re-posting your question to the user mailing list.

The Status Logger is a special logger used by log4j internally.
If you set it to "debug" or "trace" (by starting your config xml file
with <Configuration
status="debug">...),
it will output things like which appenders and loggers were initialized,
which log4j plugins were found, etc.
Any configuration problems will show up in the status log.
The status log output will appear on the console (System.out).

In JConsole, this internal logging is what you see in the StatusLogger tab.

I'm guessing from your question that you would like to see the log
statements produced by your application in the JConsole viewer.
Unfortunately, JMX currently does not provide a way to show the content of
application log files.

If you are looking for a tool that allows you to view the log file from a
remote machine you may want to take a look at Chainsaw.
http://logging.apache.org/chainsaw/

Scott Deboy has been doing work to make Chainsaw's zeroconf feature work
well with log4j2.
I am not that familiar with Chainsaw, but perhaps this documentation can
get you started:
http://logging.apache.org/log4j/2.x/manual/configuration.html#AdvertisingAppenderConfigurations

Best regards,
Remko



On Tue, Oct 29, 2013 at 9:58 AM, Mahesh Dilhan <ma...@gmail.com>wrote:

> 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
>
> log4j2.xml
>
> <?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">
>   <Appenders>
>     <!-- Async Loggers will auto-flush in batches, so switch off
> immediateFlush. -->
>     <RandomAccessFile name="RandomAccessFile"
> fileName="asyncWithLocation.log"
>               immediateFlush="false" append="false">
>       <PatternLayout>
>         <Pattern>%d %p %class{1.} [%t] %location %m %ex%n</Pattern>
>       </PatternLayout>
>     </RandomAccessFile>
>
>   </Appenders>
>   <Loggers >
>     <!-- pattern layout actually uses location, so we need to include it
> -->
>     <AsyncLogger  name="notificationLogger" level="trace"
> includeLocation="true">
>       <AppenderRef ref="RandomAccessFile"/>
>     </AsyncLogger>
>     <Root level="debug" includeLocation="true">
>       <AppenderRef ref="notificationLogger"/>
>     </Root>
>   </Loggers>
> </Configuration>
>
> <!-- 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
> http://logging.apache.org/log4j/2.x/manual/jmx.html,
>
> it would be great if above documentation is updated with a sample of
> log4j2.xml configuration.
>
> Thanks
>
> Mahesh
>