| career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

// Here is a code example to configure the JDBCAppender with a configuration-file

import org.apache.log4j.*;
import java.sql.*;
import java.lang.*;
import java.util.*;

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 !
         Driver d = (Driver)(Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
      catch(Exception e){}

      // Set the priority which messages have to be logged

      // Configuration with configuration-file

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

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.