You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "alessio.ronchi@inwind.it" <al...@inwind.it> on 2003/02/13 15:31:42 UTC

Each level in its own file

Hi all.

I'm wondering whether it is possible to log, by the same class, two different string in two different files, with two different levels (i.e debug and info).
To explain better, I give an example:

public class HelloWorld
{
   static Logger logger = Logger.getLogger(HelloWorld.class.getName());

   public static void main(String args[]) {
      PropertyConfigurator.configureAndWatch("C:\\jakarta-log4j-1.2.7\\log4j.properties",100);
      ...
      logger.debug("first info");   //I want this only in Debug.log file
      logger.info("second info");  //I want this only in Info.log file
      ...
   }
}

Is it possible to have "first info" logged in the Debug.log file anche "second info" in Info.log file?
Any suggestion how to do it?

Thank you in advance.
Alessio




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org