net.rim.pushsdk.commons
Class LogFactory

java.lang.Object
  extended by net.rim.pushsdk.commons.LogFactory

public class LogFactory
extends Object

Factory class that configures a Log4J Logger for a given class. There must be a log4j.xml in the classpath for this class to work properly. A static instance of a Logger can be created for any class that needs logging capability.

Important: This class does not support automatic runtime reloading of the log4j configuration. You must stop and restart your application.

Usage:

 private static final Logger log = LogFactory.getLogger(YourClassThatWantsToLog.class);
 
or
 private static final Logger log = LogFactory.getLogger("pushAttemptLogger");
 

Author:
mdicesare

Constructor Summary
LogFactory()
           
 
Method Summary
static org.apache.log4j.Logger getLogger(Class<?> clazz)
          Creates or retrieves a logger for a particular class.
static org.apache.log4j.Logger getLogger(String loggerName)
          Creates or retrieves a logger with a particular name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFactory

public LogFactory()
Method Detail

getLogger

public static org.apache.log4j.Logger getLogger(Class<?> clazz)
Creates or retrieves a logger for a particular class.

Parameters:
clazz - the class to log
Returns:
the logger for the class

getLogger

public static org.apache.log4j.Logger getLogger(String loggerName)
Creates or retrieves a logger with a particular name.

Parameters:
loggerName - the name of the logger
Returns:
the logger with the given name


Copyright © 2011 Research In Motion. All Rights Reserved.