com.zmicer.utils
Class LoggingUtils

java.lang.Object
  extended by com.zmicer.utils.LoggingUtils

public class LoggingUtils
extends Object

This utility class contains logging utils (e.g. print the full stack trace of the provided exception into the log file etc.) $Author:: zmicer $
$Rev:: 57 $
* $Date:: 2007-08-23 09:16:37 #$


Constructor Summary
LoggingUtils()
           
 
Method Summary
static void debug(org.apache.log4j.Logger log, Class claz, String message)
          Perform the debugging: the information about the class is added.
static void error(org.apache.log4j.Logger log, Class claz, String message)
          Perform the debugging of error: the information about the class is added.
static void logException(org.apache.log4j.Logger logger, Throwable t, String message, Class claz)
          This method prints the full stack trace of the given exception into the log file associated with the provided Logger instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingUtils

public LoggingUtils()
Method Detail

logException

public static void logException(org.apache.log4j.Logger logger,
                                Throwable t,
                                String message,
                                Class claz)
This method prints the full stack trace of the given exception into the log file associated with the provided Logger instance.

Parameters:
logger - the log4j Logger we need to use. Can not be null (otherwise IllegalArgumentException would appear).
t - Throwable to be logged.
message - the message to be added to the logging. could be null
claz - Class instantiated the process of the logging the exception. Could be null.

debug

public static void debug(org.apache.log4j.Logger log,
                         Class claz,
                         String message)
Perform the debugging: the information about the class is added. This method should be used with the Loggers which are not the class based but depends on the logging category.

Parameters:
log - Logger instance. Can not be null (otherwise IllegalArgumentException would appear).
claz - Class instance which is necessary to obtain the base name of the class to add this info to the log file. Can not be null (otherwise IllegalArgumentException would appear).
message - String message to be logged.

error

public static void error(org.apache.log4j.Logger log,
                         Class claz,
                         String message)
Perform the debugging of error: the information about the class is added. This method should be used with the Loggers which are not the class based but depends on the logging category.

Parameters:
log - Logger instance. Can not be null (otherwise IllegalArgumentException would appear).
claz - Class instance which is necessary to obtain the base name of the class to add this info to the log file. Can not be null (otherwise IllegalArgumentException would appear).
message - String message to be logged.


Copyright © 2007 jzmicer.team. All Rights Reserved.