You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by micky none <ha...@rediffmail.com> on 2005/01/20 19:03:54 UTC

Logger file

Hi Friends,
I am using this file for outputting log data,can someone please tell me how to save this data to some file instead of outputting,so that I can have a look at it later on...
any help would be appreciated
 import org.apache.log4j.Logger;
 import org.apache.log4j.BasicConfigurator;


 public class MyApp {

   static Logger logger = Logger.getLogger(MyApp.class);

   public static void main(String[] args) {


     BasicConfigurator.configure();

     logger.info("Entering application.");
     System.out.println("Log file");

     logger.info("Exiting application.");
   }
 }

[OT]Re: Logger file

Posted by Roberto Cosenza <ro...@infoflexconnect.se>.
Check on log4j homepage.
One strategy is to have a log4j.properties file in your classpath. There you
will define where you want your log file to be saved.
Please do not discuss this argument on this mailing list since it is not
tomcat related.

/Roberto
----- Original Message -----
From: "micky none" <ha...@rediffmail.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Thursday, January 20, 2005 7:03 PM
Subject: Logger file



Hi Friends,
I am using this file for outputting log data,can someone please tell me how
to save this data to some file instead of outputting,so that I can have a
look at it later on...
any help would be appreciated
 import org.apache.log4j.Logger;
 import org.apache.log4j.BasicConfigurator;


 public class MyApp {

   static Logger logger = Logger.getLogger(MyApp.class);

   public static void main(String[] args) {


     BasicConfigurator.configure();

     logger.info("Entering application.");
     System.out.println("Log file");

     logger.info("Exiting application.");
   }
 }




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