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:

------log4j.properties------
log4j.rootLogger=info, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%m%n
----------------------------

That should be enough to begin working.

Regards,
Ognjen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to