logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: Switching log levels at runtime with log4j2
Date Tue, 29 Nov 2016 04:31:33 GMT
You could use the log4j-core implementation of LoggerContext.getLoggers()
to list the current known loggers.

https://logging.apache.org/log4j/2.x/log4j-core/apidocs/org/apache/logging/log4j/core/LoggerContext.html#getLoggers()

You could also use the JMX API for LoggerConfigAdminMBean to query the list
of loggers. You could look at the log4j-jmx-gui source code for ideas.

On 28 November 2016 at 16:19, Gary Gregory <garydgregory@gmail.com> wrote:

> On Mon, Nov 28, 2016 at 2:13 PM, Marcel Stör <marcel@frightanic.com>
> wrote:
>
> > On 28.11.16 21:58, Gary Gregory wrote:
> > > Does this help:
> > > https://garygregory.wordpress.com/2016/01/11/changing-log-
> > levels-in-log4j2/
> >
> > Yes it does, thanks a lot! Since you commented only on the first part of
> > my message (how to migrate our Servlet to log4j2) can I assume there's
> > no out-of-the-box log4j2 feature that would be better suited than our
> > custom code?
> >
>
> How about this: https://logging.apache.org/log4j/2.x/manual/webapp.html
>
> Gary
>
>
> >
> > --
> > Marcel Stör, http://frightanic.com
> > Couchsurfing: http://www.couchsurfing.com/people/marcelstoer
> > O< ascii ribbon campaign - stop html mail - http://j.mp/1OThh9L
> >
> >
>
>
> --
> E-Mail: garydgregory@gmail.com | ggregory@apache.org
> Java Persistence with Hibernate, Second Edition
> <https://www.amazon.com/gp/product/1617290459/ref=as_li_
> tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1617290459&
> linkCode=as2&tag=garygregory-20&linkId=cadb800f39946ec62ea2b1af9fe6a2b8>
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=
> 1617290459>
> JUnit in Action, Second Edition
> <https://www.amazon.com/gp/product/1935182021/ref=as_li_
> tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182021&
> linkCode=as2&tag=garygregory-20&linkId=31ecd1f6b6d1eaf8886ac902a24de418%22
> >
>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=
> 1935182021>
> Spring Batch in Action
> <https://www.amazon.com/gp/product/1935182951/ref=as_li_
> tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=1935182951&
> linkCode=%7B%7BlinkCode%7D%7D&tag=garygregory-20&linkId=%7B%
> 7Blink_id%7D%7D%22%3ESpring+Batch+in+Action>
> <http:////ir-na.amazon-adsystem.com/e/ir?t=garygregory-20&l=am2&o=1&a=
> 1935182951>
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory
>



-- 
Matt Sicker <boards@gmail.com>

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