View RSS Feed

Log4j

Obtaining a Log Object

Rate this Entry
by , 02-24-2012 at 07:19 PM (750 Views)
For using the Java Common Logging SPI, use these import statements in Java class file.
Java Code:
import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory;
It shall be noted that few components which use JCL might extend the Log or may be able to give “component specific” LogFactory implementation. Initialize & declare log attributes for each class definition, as following:

Java Code:
public class CLASS
{
    private Log log = LogFactory.getLog(CLASS.class);
    ...
    ;

Submit "Obtaining a Log Object" to Facebook Submit "Obtaining a Log Object" to Digg Submit "Obtaining a Log Object" to del.icio.us Submit "Obtaining a Log Object" to StumbleUpon Submit "Obtaining a Log Object" to Google

Tags: log object Add / Edit Tags
Categories
Commons Lang

Comments