FileDocCategorySizeDatePackage
XLogger.javaAPI DocApache log4j 1.2.154174Sat Aug 25 00:09:32 BST 2007org.apache.log4j.customLogger

XLogger

public class XLogger extends Logger implements OptionHandler
A simple example showing Logger sub-classing. It shows the minimum steps necessary to implement one's {@link LoggerFactory}. Note that sub-classes follow the hierarchy even if its loggers belong to different classes.

Fields Summary
private static String
FQCN
private static XFactory
factory
String
suffix
Constructors Summary
protected XLogger(String name)
Just calls the parent constuctor.


              
     
    super(name);
  
Methods Summary
public voidactivateOptions()
Nothing to activate.

  
public voiddebug(java.lang.String message)
Overrides the standard debug method by appending the value of suffix variable to each message.

    super.log(FQCN, Level.DEBUG, message + " " + suffix, null);
  
public static org.apache.log4j.LoggergetLogger(java.lang.String name)

    return LogManager.getLogger(name, factory);
  
public static org.apache.log4j.LoggergetLogger(java.lang.Class clazz)

    return XLogger.getLogger(clazz.getName());
  
public java.lang.StringgetSuffix()

    return suffix;
  
public voidlethal(java.lang.String message, java.lang.Throwable t)
We introduce a new printing method in order to support {@link XLevel#LETHAL}.

 
    if(repository.isDisabled(XLevel.LETHAL_INT)) 
      return;
    if(XLevel.LETHAL.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, XLevel.LETHAL, message, t);
  
public voidlethal(java.lang.String message)
We introduce a new printing method in order to support {@link XLevel#LETHAL}.

 
    if(repository.isDisabled(XLevel.LETHAL_INT)) 
      return;
    if(XLevel.LETHAL.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, XLevel.LETHAL, message, null);
  
public voidsetSuffix(java.lang.String suffix)

    this.suffix = suffix;
  
public voidtrace(java.lang.String message, java.lang.Throwable t)
We introduce a new printing method that takes the TRACE level.

 
    if(repository.isDisabled(XLevel.TRACE_INT))
      return;   
    if(XLevel.TRACE.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, XLevel.TRACE, message, t);
  
public voidtrace(java.lang.String message)
We introduce a new printing method that takes the TRACE level.

 
    if(repository.isDisabled(XLevel.TRACE_INT))
      return;   
    if(XLevel.TRACE.isGreaterOrEqual(this.getEffectiveLevel()))
      forcedLog(FQCN, XLevel.TRACE, message, null);