The Configurator class had APIs just for this purpose. Gary On Nov 9, 2015 10:26 PM, "Matt Sicker" <boa...@gmail.com> wrote:
> Oh, good catch, never used the API like that outside of unit tests. > > On 9 November 2015 at 23:21, Ralph Goers <ralph.go...@dslextreme.com> > wrote: > > > Matt, the advice below won’t work properly. The LoggerConfig must be > > modified, not the Logger. Then updateLoggers must be called (which will > > update the logger’s level). > > > > Ralph > > > > > On Nov 9, 2015, at 9:07 PM, Matt Sicker <boa...@gmail.com> wrote: > > > > > > You can find the Logger from LogManager, cast to > > > org.apache.logging.log4j.core.Logger, and use setLevel, though I bet > > > there's a better way to do this via configuration files. You can reload > > the > > > configuration file and modify that from the user, but that might be > > > overkill here. > > > > > > On 9 November 2015 at 21:59, John Lussmyer <john.lussm...@efi.com > > <mailto:john.lussm...@efi.com>> wrote: > > > > > >> Looking at https://logging.apache.org/log4j/2.0/manual/jmx.html > > >> Doesn't seem like the solution. > > >> Asking the user to bring up jconsole seems rather excessive. > > >> I just want to provide 3 radio buttons in my configuration. Logging > > >> Normal, Medium, Full. > > >> > > >> -----Original Message----- > > >> From: Matt Sicker [mailto:boa...@gmail.com] > > >> Sent: Monday, November 09, 2015 7:54 PM > > >> To: Log4J Users List > > >> Subject: Re: Change log level on the fly? > > >> > > >> Loggers can be reconfigured through JMX. > > >> > > >> On 9 November 2015 at 19:53, John Lussmyer <john.lussm...@efi.com> > > wrote: > > >> > > >>> I'm hoping there is an easy to to just change the root level of my > > >>> logger configuration on the fly. > > >>> I want to be able to provide a configuration option to my users to > > >>> turn up the logging level. > > >>> I don't want to reconfigure everything, just change the level. > > >>> > > >>> Is there any easy way to do that? Or do I have to build a > > >>> Configuration factory? > > >>> > > >>> > > >>> ________________________________ > > >>> Confidentiality notice: This message may contain confidential > > >> information. > > >>> It is intended only for the person to whom it is addressed. If you > are > > >>> not that person, you should not use this message. We request that you > > >>> notify us by replying to this message, and then delete all copies > > >>> including any contained in your reply. Thank you. > > >>> > > >> > > >> > > >> > > >> -- > > >> Matt Sicker <boa...@gmail.com> > > >> > > > > > > > > > > > > -- > > > Matt Sicker <boa...@gmail.com <mailto:boa...@gmail.com>> > > > > > > > -- > Matt Sicker <boa...@gmail.com> >