| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.oozie.util.XLog
public class XLog
The XLog class extends the functionality of the Apache common-logging Log interface. 
| Nested Class Summary | |
|---|---|
| static class | XLog.InfoLogInfostores contextual information to create log prefixes. | 
| static class | XLog.Level | 
| Field Summary | |
|---|---|
| static int | OPSMask for tee logging to the OPS log. | 
| static int | STDMask for logging to the standard log. | 
| Constructor Summary | |
|---|---|
| XLog(org.apache.commons.logging.Log log)Create a XLogwith no prefix. | |
| XLog(org.apache.commons.logging.Log log,
         String prefix)Create a XLogwith a common prefix. | |
| Method Summary | |
|---|---|
|  void | debug(int loggerMask,
           String msgTemplate,
           Object... params)Tee Log a debug message Exceptionto the common log and specifiedLogs. | 
|  void | debug(Object o)Log a debug message to the common Log. | 
|  void | debug(Object o,
           Throwable throwable)Log a debug message and Exceptionto the commonLog. | 
|  void | debug(String msgTemplate,
           Object... params)Log a debug message Exceptionto the commonLog. | 
|  void | error(int loggerMask,
           String msgTemplate,
           Object... params)Tee Log a error message Exceptionto the common log and specifiedLogs. | 
|  void | error(Object o)Log a error message to the common Log. | 
|  void | error(Object o,
           Throwable throwable)Log a error message and Exceptionto the commonLog. | 
|  void | error(String msgTemplate,
           Object... params)Log a error message Exceptionto the commonLog. | 
|  void | fatal(int loggerMask,
           String msgTemplate,
           Object... params)Tee Log a fatal message Exceptionto the common log and specifiedLogs. | 
|  void | fatal(Object o)Log a fatal message to the common Log. | 
|  void | fatal(Object o,
           Throwable throwable)Log a fatal message and Exceptionto the commonLog. | 
|  void | fatal(String msgTemplate,
           Object... params)Log a fatal message Exceptionto the commonLog. | 
| static String | format(String msgTemplate,
             Object... params)Utility method that does uses the StringFormatto format the message template using the provided
 parameters. | 
| static Throwable | getCause(Object... params)Utility method that extracts the Throwable, if present, from the parameters. | 
| static XLog | getLog(Class clazz)Return the named logger configured with the XLog.Infoprefix. | 
| static XLog | getLog(Class clazz,
             boolean prefix)Return the named logger. | 
| static XLog | getLog(String name)Return the named logger configured with the XLog.Infoprefix. | 
| static XLog | getLog(String name,
             boolean prefix)Return the named logger. | 
|  String | getMsgPrefix()Return the common prefix. | 
|  void | info(int loggerMask,
         String msgTemplate,
         Object... params)Tee Log a info message Exceptionto the common log and specifiedLogs. | 
|  void | info(Object o)Log a info message to the common Log. | 
|  void | info(Object o,
         Throwable throwable)Log a info message and Exceptionto the commonLog. | 
|  void | info(String msgTemplate,
         Object... params)Log a info message Exceptionto the commonLog. | 
|  boolean | isDebugEnabled()Return if debug logging is enabled. | 
|  boolean | isErrorEnabled()Return if error logging is enabled. | 
|  boolean | isFatalEnabled()Return if fatal logging is enabled. | 
|  boolean | isInfoEnabled()Return if info logging is enabled. | 
|  boolean | isTraceEnabled()Return if trace logging is enabled. | 
|  boolean | isWarnEnabled()Return if warn logging is enabled. | 
| static XLog | resetPrefix(XLog log)Reset the logger prefix | 
|  void | setMsgPrefix(String prefix)Set the common prefix. | 
|  void | trace(int loggerMask,
           String msgTemplate,
           Object... params)Tee Log a trace message Exceptionto the common log and specifiedLogs. | 
|  void | trace(Object o)Log a trace message to the common Log. | 
|  void | trace(Object o,
           Throwable throwable)Log a trace message and Exceptionto the commonLog. | 
|  void | trace(String msgTemplate,
           Object... params)Log a trace message Exceptionto the commonLog. | 
|  void | warn(int loggerMask,
         String msgTemplate,
         Object... params)Tee Log a warn message Exceptionto the common log and specifiedLogs. | 
|  void | warn(Object o)Log a warn message to the common Log. | 
|  void | warn(Object o,
         Throwable throwable)Log a warn message and Exceptionto the commonLog. | 
|  void | warn(String msgTemplate,
         Object... params)Log a warn message Exceptionto the commonLog. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int STD
public static final int OPS
| Constructor Detail | 
|---|
public XLog(org.apache.commons.logging.Log log)
XLog with no prefix.
log - Log instance to use for logging.
public XLog(org.apache.commons.logging.Log log,
            String prefix)
XLog with a common prefix.  The prefix will be prepended to all log messages.
log - Log instance to use for logging.prefix - common prefix to use for all log messages.| Method Detail | 
|---|
public static XLog getLog(String name)
XLog.Info prefix.
name - logger name.
XLog.Info prefix.public static XLog getLog(Class clazz)
XLog.Info prefix.
clazz - from which the logger name will be derived.
XLog.Info prefix.
public static XLog getLog(String name,
                          boolean prefix)
name - logger name.prefix - indicates if the XLog.Info prefix has to be used or not.
public static XLog getLog(Class clazz,
                          boolean prefix)
clazz - from which the logger name will be derived.prefix - indicates if the XLog.Info prefix has to be used or not.
public static XLog resetPrefix(XLog log)
log - the named logger
public String getMsgPrefix()
public void setMsgPrefix(String prefix)
prefix - the common prefix to set.public void debug(Object o)
Log.
debug in interface org.apache.commons.logging.Logo - message.
public void debug(Object o,
                  Throwable throwable)
Exception to the common Log.
debug in interface org.apache.commons.logging.Logo - message.throwable - exception.public void error(Object o)
Log.
error in interface org.apache.commons.logging.Logo - message.
public void error(Object o,
                  Throwable throwable)
Exception to the common Log.
error in interface org.apache.commons.logging.Logo - message.throwable - exception.public void fatal(Object o)
Log.
fatal in interface org.apache.commons.logging.Logo - message.
public void fatal(Object o,
                  Throwable throwable)
Exception to the common Log.
fatal in interface org.apache.commons.logging.Logo - message.throwable - exception.public void info(Object o)
Log.
info in interface org.apache.commons.logging.Logo - message.
public void info(Object o,
                 Throwable throwable)
Exception to the common Log.
info in interface org.apache.commons.logging.Logo - message.throwable - exception.public void trace(Object o)
Log.
trace in interface org.apache.commons.logging.Logo - message.
public void trace(Object o,
                  Throwable throwable)
Exception to the common Log.
trace in interface org.apache.commons.logging.Logo - message.throwable - exception.public void warn(Object o)
Log.
warn in interface org.apache.commons.logging.Logo - message.
public void warn(Object o,
                 Throwable throwable)
Exception to the common Log.
warn in interface org.apache.commons.logging.Logo - message.throwable - exception.public boolean isDebugEnabled()
isDebugEnabled in interface org.apache.commons.logging.Logtrue if debug logging is enable, false if not.public boolean isErrorEnabled()
isErrorEnabled in interface org.apache.commons.logging.Logtrue if error logging is enable, false if not.public boolean isFatalEnabled()
isFatalEnabled in interface org.apache.commons.logging.Logtrue if fatal logging is enable, false if not.public boolean isInfoEnabled()
isInfoEnabled in interface org.apache.commons.logging.Logtrue if info logging is enable, false if not.public boolean isTraceEnabled()
isTraceEnabled in interface org.apache.commons.logging.Logtrue if trace logging is enable, false if not.public boolean isWarnEnabled()
isWarnEnabled in interface org.apache.commons.logging.Logtrue if warn logging is enable, false if not.
public void fatal(String msgTemplate,
                  Object... params)
Exception to the common Log.
msgTemplate - message template.params - parameters for the message template. If the last parameter is an exception it is logged as such.
public void error(String msgTemplate,
                  Object... params)
Exception to the common Log.
msgTemplate - message template.params - parameters for the message template. If the last parameter is an exception it is logged as such.
public void info(String msgTemplate,
                 Object... params)
Exception to the common Log.
msgTemplate - message template.params - parameters for the message template. If the last parameter is an exception it is logged as such.
public void warn(String msgTemplate,
                 Object... params)
Exception to the common Log.
msgTemplate - message template.params - parameters for the message template. If the last parameter is an exception it is logged as such.
public void debug(String msgTemplate,
                  Object... params)
Exception to the common Log.
msgTemplate - message template.params - parameters for the message template. If the last parameter is an exception it is logged as such.
public void trace(String msgTemplate,
                  Object... params)
Exception to the common Log.
msgTemplate - message template.params - parameters for the message template. If the last parameter is an exception it is logged as such.
public void fatal(int loggerMask,
                  String msgTemplate,
                  Object... params)
Exception to the common log and specified Logs.
loggerMask - log mask, it is a bit mask, possible values are APP and OPS.msgTemplate - message template.params - parameters for the message template.
public void error(int loggerMask,
                  String msgTemplate,
                  Object... params)
Exception to the common log and specified Logs.
loggerMask - log mask, it is a bit mask, possible values are APP and OPS.msgTemplate - message template.params - parameters for the message template.
public void info(int loggerMask,
                 String msgTemplate,
                 Object... params)
Exception to the common log and specified Logs.
loggerMask - log mask, it is a bit mask, possible values are APP and OPS.msgTemplate - message template.params - parameters for the message template.
public void warn(int loggerMask,
                 String msgTemplate,
                 Object... params)
Exception to the common log and specified Logs.
loggerMask - log mask, it is a bit mask, possible values are APP and OPS.msgTemplate - message template.params - parameters for the message template.
public void debug(int loggerMask,
                  String msgTemplate,
                  Object... params)
Exception to the common log and specified Logs.
loggerMask - log mask, it is a bit mask, possible values are APP and OPS.msgTemplate - message template.params - parameters for the message template.
public void trace(int loggerMask,
                  String msgTemplate,
                  Object... params)
Exception to the common log and specified Logs.
loggerMask - log mask, it is a bit mask, possible values are APP and OPS.msgTemplate - message template.params - parameters for the message template.
public static String format(String msgTemplate,
                            Object... params)
StringFormat to format the message template using the provided
 parameters.  In addition to the StringFormat syntax for message templates, it supports
 {E} for ENTER.  The last parameter is ignored for the formatting if it is an Exception.
msgTemplate - message template.params - paramaters to use in the template. If the last parameter is an Exception, it is ignored.
public static Throwable getCause(Object... params)
Throwable, if present, from the parameters.
params - parameters.
Throwable instance if it is the last parameter, null otherwise.| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||