de.fzj.unicore.wsrflite.utils
Class Log

java.lang.Object
  extended by de.fzj.unicore.wsrflite.utils.Log

public class Log
extends Object


Field Summary
static String ADMIN
          logger prefix for admin stuff
static String PERSISTENCE
          logger prefix for persistence related code
static String SERVICES
          logger prefix for services
static String WSRFLITE
          logger prefix for general WSRFlite code
 
Constructor Summary
protected Log()
           
 
Method Summary
static void cleanLogContext()
           
static String createFaultMessage(String message, Throwable cause)
          construct a user-friendly error message
static org.apache.log4j.Logger getLogger(String prefix, Class<?> clazz)
          returns a logger, using the given prefix and the simple name of the given class
static String getLoggerName(String prefix, Class<?> clazz)
          returns a logger name, using the given prefix and the simple name of the given class
static void logException(String message, Throwable cause)
          log an error message to the default logger ("unicore.wsrflite") A human-friendly message is constructed and logged at "INFO" level.
static void logException(String message, Throwable cause, org.apache.log4j.Logger logger)
          log an error message to the specified logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ADMIN

public static final String ADMIN
logger prefix for admin stuff

See Also:
Constant Field Values

WSRFLITE

public static final String WSRFLITE
logger prefix for general WSRFlite code

See Also:
Constant Field Values

PERSISTENCE

public static final String PERSISTENCE
logger prefix for persistence related code

See Also:
Constant Field Values

SERVICES

public static final String SERVICES
logger prefix for services

See Also:
Constant Field Values
Constructor Detail

Log

protected Log()
Method Detail

getLoggerName

public static String getLoggerName(String prefix,
                                   Class<?> clazz)
returns a logger name, using the given prefix and the simple name of the given class

Parameters:
prefix - - the prefix to use
clazz - - the class
Returns:
logger name

getLogger

public static org.apache.log4j.Logger getLogger(String prefix,
                                                Class<?> clazz)
returns a logger, using the given prefix and the simple name of the given class

Parameters:
prefix - - the prefix to use
clazz - - the class
Returns:
logger

logException

public static void logException(String message,
                                Throwable cause)
log an error message to the default logger ("unicore.wsrflite") A human-friendly message is constructed and logged at "INFO" level. The stack trace is logged at "DEBUG" level.

Parameters:
message - - the error message
cause - - the cause of the error

logException

public static void logException(String message,
                                Throwable cause,
                                org.apache.log4j.Logger logger)
log an error message to the specified logger. A human-friendly message is constructed and logged at "ERROR" level. The stack trace is logged at "DEBUG" level.

Parameters:
message - - the error message
cause - - the cause of the error
logger - - the logger to use

createFaultMessage

public static String createFaultMessage(String message,
                                        Throwable cause)
construct a user-friendly error message

Parameters:
message -
cause -
Returns:

cleanLogContext

public static void cleanLogContext()


Copyright © 2010. All Rights Reserved.