eu.emi.client.util
Class Log

java.lang.Object
  extended by eu.emi.client.util.Log

public class Log
extends Object

Author:
a.memon

Field Summary
static String CLIENT
           
static String DSR
          logger prefix for services
static String DSRCLIENT
          logger prefix for client stack
static String DSRDB
          logger prefix for client stack
static String SECURITY
           
 
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.
static void logException(Throwable cause)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DSR

public static final String DSR
logger prefix for services

See Also:
Constant Field Values

DSRCLIENT

public static final String DSRCLIENT
logger prefix for client stack

See Also:
Constant Field Values

DSRDB

public static final String DSRDB
logger prefix for client stack

See Also:
Constant Field Values

SECURITY

public static final String SECURITY
See Also:
Constant Field Values

CLIENT

public static final String CLIENT
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

logException

public static void logException(Throwable cause)

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 © 2012 EMI. All Rights Reserved.