Hi,

Which configuration file are you using?
If you're using XML try this:
<Configuration
        status="debug"...

You should then see something along the lines of 

2013-10-24 14:03:09,332 DEBUG Calling createLogger on class 
org.apache.logging.log4j.core.config.LoggerConfig$RootLogger for element Root 
with params(additivity="null", level="info", includeLocation="null", 
AppenderRef={STDOUT, FLOW, EXCEPTION}, Properties={}, 
Configuration(HereWillBeYourConfigurationName), null)

Does it print the name of the logger you are looking for in your application?


/Alex



-----Ursprüngliche Nachricht-----
Von: David KOCH [mailto:[email protected]] 
Gesendet: Donnerstag, 24. Oktober 2013 12:04
An: [email protected]
Betreff: How to get loggers configured in log4j2.xml

Hello,

How can I check inside the application if a particular logger has been 
configured in the log4j configuration file?

LogManager.getContext(...).hasLogger(<name>) always returns "false" even though 
I know the logger has been configured.

Thank you,

/David

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to