Log4j:How can i apply logging mechanism to particular packages or classes related to my application?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Krishna_Kumar
Posted On:   Thursday, April 13, 2006 04:35 AM

How can i apply logging mechanism to particular packages or classes related to my application?


Please use html tags to format code blocks.

Re: Log4j:How can i apply logging mechanism to particular packages

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, April 29, 2006 03:22 PM

In my classes I usually say "Logger logger = Logger.getLogger(myClass.class)" and this means it will use a Logger that has the same name as the fully-qualified name (including package prefix) of the class.



Then in the log4j.properties or log4j.xml you can change the level of particular loggers, or assign them to different Appenders, etc. by using the package names.
About | Sitemap | Contact