Please see http://people.apache.org/~rgoers/log4j2/manual/customconfig.html

Ralph

On Jun 23, 2014, at 3:44 AM, Phil Wray <[email protected]> wrote:

> Classification: Public
> 
> Hi,
> Would like to turn on debug for a particular class or package at runtime, 
> either via jmx or programmatically, where this class or package is 
> arbitrary and not known at start up time please.
> I can't see a way to do this?
> Previous posts titled "Programmatic configuration of loggers" show how to 
> do this for an existing named logger but not for an arbitrary class or 
> package which is a typical use case.
> LoggerConfig loggerConfig = config.getLoggerConfig(loggerName);
> 
> But this returns the root logger if no existing logger for that name 
> exists - and we can't just enable debug on everything.
> Is there a way of adding a new LoggerConfig into the configuration?
> 
> thanks,
> Phil Wray
> 
> 
> 
> 
> ---
> 
> This e-mail may contain confidential and/or privileged information. If you 
> are not the intended recipient (or have received this e-mail in error) please 
> notify the sender immediately and delete this e-mail. Any unauthorized 
> copying, disclosure or distribution of the material in this e-mail is 
> strictly forbidden.
> 
> Please refer to http://www.db.com/en/content/eu_disclosures.htm for 
> additional EU corporate and regulatory disclosures and to 
> http://www.db.com/unitedkingdom/content/privacy.htm for information about 
> privacy.

Reply via email to