logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pradipta Chatterjee" <pchatter...@omnispace.com>
Subject Logging into Files
Date Wed, 04 Apr 2001 21:17:40 GMT
Hi,
I am a beginner to the Log4J community and was inetersted to use this to log
my Sys.out to specific txt files.

My Code
=======
import org.apache.log4j.*;


public class Class1 {
      public static void main(String args[]){
	  BasicConfigurator.configure();

        Category cat = Category.getInstance(Class1.class.getName());

          //cat.addAppender(A1); ******* I tried this step but could not
follow how to direct output to a file

        cat.setPriority(Priority.DEBUG);
        cat.warn("Low fuel level.");
        cat.debug("Starting search for nearest gas station.");
      }//end of main

}//end of Class1

The Purpose of my application is to direct the Sys.out to a log file say
C:\Test.log.txt.
Obviously I am missing something....some intermediate step.

Can anyone please let me know how to solve this? Any URL or sample code is
welcome.

I apologise for sounding so illiterate.

Thanks and Regards,

Prodi.


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


Mime
View raw message