1 Sep 2008 11:02
Re: HOw to replace the system.out.println
Ognjen Blagojevic <ognjen <at> etf.bg.ac.yu>
2008-09-01 09:02:14 GMT
2008-09-01 09:02:14 GMT
MY POI wrote:
> Dear all
>
> I want to use the logging system in my Project which consist of
> many modules developing by the
>
> much developers. Here I need to replace system.out.println statements and i
> want put loggers.
>
> Is there any way to configuring one property file to replace the statements.
>
> Many thanks in advance
> Rajesh
At the beginning of every class you should put:
private static Logger logger = Logger.getLogger(ClassName.class);
Than, instead of
System.out.println("...");
use
logger.logMethod("...")
where logMethod is info/warning/debug etc.
In the end, put log4j.properties in the src.folder:
(Continue reading)
RSS Feed