contribs/ThomasFenner/Log4JTest.java [130:155]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class Log4JTest
{
	// Create a category instance for this class
   static Category cat = Category.getInstance(Log4JTest.class.getName());

   public static void main(String[] args)
   {
      // Ensure to have all necessary drivers installed !
   	try
      {
			Driver d = (Driver)(Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
			DriverManager.registerDriver(d);
		}
      catch(Exception e){}

      // Set the priority which messages have to be logged
		cat.setPriority(Priority.INFO);

		// Configuration with configuration-file
		PropertyConfigurator.configure("log4jtestprops.txt");

      // These messages with Priority >= setted priority will be logged to the database.
  		cat.debug("debug");  //this not, because Priority DEBUG is less than INFO
      cat.info("info");
      cat.error("error");
      cat.fatal("fatal");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



contribs/ThomasFenner/code_example1.java [25:50]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
public class Log4JTest
{
   // Create a category instance for this class
   static Category cat = Category.getInstance(Log4JTest.class.getName());

   public static void main(String[] args)
   {
      // Ensure to have all necessary drivers installed !
      try
      {
         Driver d = (Driver)(Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
         DriverManager.registerDriver(d);
      }
      catch(Exception e){}

      // Set the priority which messages have to be logged
      cat.setPriority(Priority.INFO);

      // Configuration with configuration-file
      PropertyConfigurator.configure("log4jtestprops.txt");

      // These messages with Priority >= setted priority will be logged to the database.
      cat.debug("debug");  //this not, because Priority DEBUG is less than INFO
      cat.info("info");
      cat.error("error");
      cat.fatal("fatal");
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



