dcsimg
How to config Log4j to change output format of my application messages produced through System.out.println()
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   J_Y
Posted On:   Sunday, December 4, 2005 08:20 PM

I am using JBoss 3.2.3 for my web application. From my application sometimes I print messages using System.out.println(). Jboss prints those messages on both Console and server.log in this format: yyyy-mm-dd hh:mm:ss,SSS INFO [STDOUT] ...message... I want those messages to print in this format: yyyy-mm-dd hh:mm:ss,SSS ...message... I have figured out that if I change output format to for Console and server.log in JBoss's log4j.xml under /conf then it will do the trick. Problem with this solution is that it applies to all the messag   More>>

I am using JBoss 3.2.3 for my web application. From my application sometimes I print messages using System.out.println(). Jboss prints those messages on both Console and server.log in this format:



yyyy-mm-dd hh:mm:ss,SSS INFO [STDOUT] ...message...





I want those messages to print in this format:



yyyy-mm-dd hh:mm:ss,SSS ...message...





I have figured out that if I change output format to









for Console and server.log in JBoss's log4j.xml under /conf then it will do the trick.



Problem with this solution is that it applies to all the messages including messages produced by other apps like JBoss, Apache etc. when infact i only want to apply it to
messages produced by my app using System.out.println().


One thing which may help is that all my messages using System.out.println() starts with following 5 characters: "PEND:" or "WEBF:"


Please reply. Thanks

   <<Less

Re: How to config Log4j to change output format of my application messages produced through System.out.println()

Posted By:   ankush_purwar  
Posted On:   Monday, December 5, 2005 01:20 AM

Try to use named logger.Hope it will solve your problem.
About | Sitemap | Contact