FileDocCategorySizeDatePackage
TxLogger.javaAPI DocExample8981Tue May 29 16:57:16 BST 2007com.sun.xml.ws.tx.common

TxLogger

public final class TxLogger extends Object
This is a helper class that provides some convenience methods wrapped around the standard {@link java.util.logging.Logger} interface.

Logging domains: wstx // general for all web service transactions wstx.wscoord // for ws-coordination logging wstx.at // for ws-atomic transaction logging.

see
#getLogger(Class)
see
#getATLogger(Class)
see
#getCoordLogger(Class)

Fields Summary
private static final String
LOGGING_SUBSYSTEM_NAME
If we run with JAX-WS, we are using its logging domain (appended with ".wstx"). Otherwise we default to "wstx".
private final String
componentClassName
private final Logger
logger
Constructors Summary
private TxLogger(String componentName)
Prevents creation of a new instance of this TxLogger

        this.componentClassName = "[" + componentName + "] ";
        this.logger = java.util.logging.Logger.getLogger(LOGGING_SUBSYSTEM_NAME);
    
private TxLogger(String componentName, String subsystem)

        this.componentClassName = "[" + componentName + "] ";

        this.logger = java.util.logging.Logger.getLogger(LOGGING_SUBSYSTEM_NAME + subsystem);
    
Methods Summary
public voidconfig(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.CONFIG, componentClassName, methodName, message);
    
public voidconfig(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.CONFIG, componentClassName, methodName, message, thrown);
    
public voidentering(java.lang.String methodName)

        logger.entering(componentClassName, methodName);
    
public voidentering(java.lang.String methodName, java.lang.Object parameter)

        logger.entering(componentClassName, methodName, parameter);
    
public voidentering(java.lang.String methodName, java.lang.Object[] parameters)

        logger.entering(componentClassName, methodName, parameters);
    
public voidexiting(java.lang.String methodName)

        logger.exiting(componentClassName, methodName);
    
public voidexiting(java.lang.String methodName, java.lang.Object result)

        logger.exiting(componentClassName, methodName, result);
    
public voidfine(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.FINE, componentClassName, methodName, message);
    
public voidfine(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.FINE, componentClassName, methodName, message, thrown);
    
public voidfiner(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.FINER, componentClassName, methodName, message);
    
public voidfiner(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.FINER, componentClassName, methodName, message, thrown);
    
public voidfinest(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.FINEST, componentClassName, methodName, message);
    
public voidfinest(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.FINEST, componentClassName, methodName, message, thrown);
    
public static com.sun.xml.ws.tx.common.TxLoggergetATLogger(java.lang.Class componentClass)
Logging specifically for *.wstx.wsat subsystem.

        return new TxLogger(componentClass.getName(), ".wsat");
    
public static com.sun.xml.ws.tx.common.TxLoggergetCoordLogger(java.lang.Class componentClass)
Logging specifically for *.wstx.wscoord subsystem.

        return new TxLogger(componentClass.getName(), ".wscoord");
    
public static com.sun.xml.ws.tx.common.TxLoggergetLogger(java.lang.Class componentClass)
The factory method returns preconfigured TxLogger wrapper for the class. Since there is no caching implemented, it is advised that the method is called only once per a class in order to initialize a final static logger variable, which is then used through the class to perform actual logging tasks.

param
componentClass class of the component that will use the logger instance. Must not be {@code null}.
return
logger instance preconfigured for use with the component
throws
NullPointerException if the componentClass parameter is {@code null}.

        return new TxLogger(componentClass.getName());
    
public voidinfo(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.INFO, componentClassName, methodName, message);
    
public voidinfo(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.INFO, componentClassName, methodName, message, thrown);
    
public booleanisLogging(java.util.logging.Level level)

        return logger.isLoggable(level);
    
public voidlog(java.util.logging.Level level, java.lang.String methodName, java.lang.String message)

        logger.logp(level, componentClassName, methodName, message);
    
public voidlog(java.util.logging.Level level, java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(level, componentClassName, methodName, message, thrown);
    
public voidsevere(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.SEVERE, componentClassName, methodName, message);
    
public voidsevere(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.SEVERE, componentClassName, methodName, message, thrown);
    
public voidwarning(java.lang.String methodName, java.lang.String message)

        logger.logp(Level.WARNING, componentClassName, methodName, message);
    
public voidwarning(java.lang.String methodName, java.lang.String message, java.lang.Throwable thrown)

        logger.logp(Level.WARNING, componentClassName, methodName, message, thrown);