On Thu, Aug 6, 2015 at 2:50 PM, Shawn Heisey <[email protected]> wrote:
> On 8/6/2015 2:44 PM, Xen wrote: > > I am led to believe that I am not meant to configure log4j2 during > > program execution. Nor can I change the configuration except by > > loading different configuration files. > > > > I am happy to assume that this is rather odd. I would like it if I had > > a main configuration file indeed, but... > > > > My application needs to adjust logging levels on the fly. That would > > be the levels indicated by LoggerConfig objects. > > The situation is similar in Solr, a fellow Apache project. Our > web-based admin UI lets the user adjust the logging levels of any > currently active class. Here's a screenshot of this: > > https://www.dropbox.com/s/zw79kvn7it9ewkp/solr-log4j-loglevels.png?dl=0 > > Can this capability be preserved if Solr upgrades the default slf4j > logging destination to log4j2? > We have a similar gadget in a work product. To do this in v2, you need to use classes in the Core module. The API module does not let you do that. This is a common and normal use case IMO, so I would be happy to entertain a discussion and patches. There might even be a JIRA about this already. If not, we need one! Gary > > The admin UI also has a view (refreshing every ten seconds) into the > actual log for anything that's at least WARN severity. This works when > the logging destination is log4j 1 or java.util.logging. We will need > to figure out how to tap into log4j2 for that display. > > Thanks, > Shawn > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- E-Mail: [email protected] | [email protected] Java Persistence with Hibernate, Second Edition <http://www.manning.com/bauer3/> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> Spring Batch in Action <http://www.manning.com/templier/> Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory
