log4j - Different Pattern for levels, configuration in XML
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vadali_v
Posted On:   Thursday, February 19, 2009 10:49 AM

Hello, I am very new to log4j, and i need to find a way to make a different logging pattern for different levels (obviously, debug has to be much more detailed..). I looked around, and found this http://wiki.apache.org/logging-log4j/UsefulCode (under "Setting The Conversion Pattern Layout Differently Per Logging Level"). Do we really have to patch up our code in order to do such an trivial task? and anyhow, i dont think this code would work with XML configuration (which is a given in my case..). What else can I do? I tried making another logger, besides my root logger, but then I get messages printed twice.. Thanks for your help,    More>>

Hello,


I am very new to log4j, and i need to find a way to make a different logging pattern for different levels (obviously, debug has to be much more detailed..). I looked around, and found this http://wiki.apache.org/logging-log4j/UsefulCode (under "Setting The Conversion Pattern Layout Differently Per Logging Level").




Do we really have to patch up our code in order to do such an trivial task? and anyhow, i dont think this code would work with XML configuration (which is a given in my case..).





What else can I do?




I tried making another logger, besides my root logger, but then I get messages printed twice..



Thanks for your help,


vadali    <<Less

Re: log4j - Different Pattern for levels, configuration in XML

Posted By:   vadali_v  
Posted On:   Thursday, February 19, 2009 11:25 AM

Well, my bad.. The link i found was indeed the solution, and it worked perfectly with xml!

thanks!
About | Sitemap | Contact