|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.server.Log
public class Log
The Log object is used to log messages to logs. It keeps a list of different Loggers, all implementing LogInterface, and asks all of them to log.
Nested Class Summary | |
---|---|
static class |
Log.InternalLogger
A collection of loggers. |
Field Summary | |
---|---|
boolean |
debug
The debug mode flag for the log. |
Constructor Summary | |
---|---|
Log(Log parentLog)
A constructor taking another Log as a parameter. |
|
Log(String resourceName)
A constructor which takes only a resource name. |
|
Log(String resourceName,
Log.InternalLogger loggers)
Deprecated. |
|
Log(String resourceName,
org.apache.log4j.Logger logger)
Deprecated. |
|
Log(String resourceName,
String category)
A constructor with both resourceName and category name |
Method Summary | |
---|---|
void |
addLogger(org.apache.log4j.Logger logger)
Deprecated. Do not use log4j directly |
void |
addLogger(LogInterface logger)
Add a LogInterface to internal list of loggers. |
void |
close()
Close the output logger |
void |
debug(String res)
Log a message with debug level if the debug mode flag is true , otherwise an info level message is logged. |
void |
debug(String res,
Object param)
Log a message with debug level if the debug mode flag is true , otherwise an info level message is logged. |
void |
debug(String res,
Object[] params)
Log a message with debug level if the debug mode flag is true , otherwise an info level message is logged. |
void |
debug(String res,
Object param1,
Object param2)
Log a message with debug level if the debug mode flag is true , otherwise an info level message is logged. |
void |
dump(Object o)
This methods dumps an Object to the log file. |
void |
dumpEntry(Entry e)
Dumps a formatted message to the logfile from the contents of an Entry |
void |
error(String res)
Log a message with error level. |
void |
error(String res,
Object[] params)
Log a message with error level. |
void |
error(String res,
Object[] params,
Throwable error)
Log a message with error level. |
void |
error(String res,
Object param,
Throwable error)
Log a message with error level. |
void |
error(String res,
String param)
Log a message with error level. |
void |
error(String res,
String param1,
String param2)
Log a message with error level. |
void |
error(String res,
Throwable error)
Log a message with error level. |
void |
exception(String res)
Throws a new exception with a custom message. |
void |
exception(String res,
Object param)
Throws a new exception with a custom message. |
void |
exception(String res,
Object[] params)
Throws a new exception with a custom message. |
void |
exception(String res,
Object param1,
Object param2)
Throws a new exception with a custom message. |
void |
fatal(String res)
Log a message with fatal level. |
void |
fatal(String res,
Object param)
Log a message with fatal level. |
void |
fatal(String res,
Object[] params)
Log a message with fatal level. |
void |
fatal(String res,
Object param,
Throwable err)
Log a message with fatal level. |
void |
fatal(String res,
Throwable err)
Log a message with fatal level. |
void |
fine(String res)
Log a message with debug level. |
void |
fine(String res,
Object param)
Log a message with debug level. |
void |
fine(String res,
Object[] params)
Log a message with debug level. |
void |
fine(String res,
Object param1,
Object param2)
Log a message with debug level. |
String |
getCategory()
Returns the category for this Log |
LogInterface |
getClassLogger(String className)
Returns a LogInterface with the given class Name. |
boolean |
getDebug()
Return the value of the debug parameter |
org.apache.log4j.Logger |
getLogger()
Deprecated. |
Vector |
getLoggers()
Returns a Vector containing all org.apache.log4j.Logger objects used by this Log. |
String |
getPrefix()
Returns the prefix to be prepended to all messages |
String |
getString(String resource)
Return the NLS string given the resource. |
String |
getString(String resource,
Object param)
Return the NLS string given the resource and a parameter. |
String |
getString(String resource,
Object[] params)
Return the NLS string given the resource and an array of parameters |
String |
getString(String resource,
Object param1,
Object param2)
Return the NLS string given the resource and two parameters |
TDILog4j |
getTDILog4j()
Returns a TDILog4j Logger connected to this Log object. |
void |
info(String res)
Log a message with info level. |
void |
info(String res,
Object param)
Log a message with info level. |
void |
info(String res,
Object[] params)
Log a message with info level. |
void |
info(String res,
Object param1,
Object param2)
Log a message with info level. |
boolean |
isDebugEnabled()
Checks whether debug is enabled. |
static boolean |
isLoggingEnabled()
Returns whether TDI logging is active or disabled. |
void |
log(String level,
String msg)
Log a message with the specified level. |
void |
logdebug(String msg)
Log a message with info level if the debug mode flag is true ,
otherwise an debug level message is logged. |
void |
logerror(String msg)
Log a message with error level. |
void |
logerror(String msg,
Throwable error)
Log a message with error level with an additional Throwable object. |
void |
logfatal(String msg)
Log a message with fatal level. |
void |
logfine(String msg)
Logs a message to the output stream. |
void |
loginfo(String msg)
Log a message with info level. |
void |
logwarn(String msg)
Log a message with warning level. |
void |
removeLogger(LogInterface logger)
Remove a LogInterface from the internal list of loggers. |
void |
setCategory(String category)
Sets the category for this Log |
void |
setDebug(boolean debug)
Sets debug parameter |
void |
setLogger(org.apache.log4j.Logger logger)
Deprecated. Do not use log4j directly |
static void |
setLoggingEnabled()
Checks the com.ibm.di.logging.enabled property to see if logging is enabled |
static void |
setLoggingEnabled(boolean enabled)
Disables or enables TDI logging. |
void |
setPrefix(String prefix)
Sets a prefix to be prepended to all messages |
void |
warn(String res)
Log a message with warning level. |
void |
warn(String res,
Object param)
Log a message with warning level. |
void |
warn(String res,
Object[] params)
Log a message with warning level. |
void |
warn(String res,
Object param1,
Object param2)
Log a message with warning level. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean debug
Constructor Detail |
---|
public Log(String resourceName)
resourceName
- Name used both as translation resource name and the category
namepublic Log(String resourceName, String category)
resourceName
- Name used for locating translation resourcecategory
- The category name for the loggers@Deprecated public Log(String resourceName, org.apache.log4j.Logger logger)
resourceName
- Name used for locating translation resourcelogger
- A Logger added to the list of loggerspublic Log(Log parentLog)
parentLog
- The other Log@Deprecated public Log(String resourceName, Log.InternalLogger loggers)
resourceName
- Name used for locating translation resourceloggers
- Used as the list of loggersMethod Detail |
---|
@Deprecated public org.apache.log4j.Logger getLogger()
public Vector getLoggers()
@Deprecated public void setLogger(org.apache.log4j.Logger logger)
logger
- The new Logger object.@Deprecated public void addLogger(org.apache.log4j.Logger logger)
logger
- The new Logger objectpublic void addLogger(LogInterface logger)
logger
- The new LogInterface object.public void removeLogger(LogInterface logger)
logger
- The LogInterface object.public TDILog4j getTDILog4j()
public LogInterface getClassLogger(String className) throws Exception
className
- The class name
Exception
- if problem occurspublic void setDebug(boolean debug)
debug
- true if debug level should be output as infopublic boolean getDebug()
boolean
valuepublic boolean isDebugEnabled()
public static void setLoggingEnabled()
public static void setLoggingEnabled(boolean enabled)
enabled
- if true
all loggers are enabled, otherwise they
are disabledpublic static boolean isLoggingEnabled()
true
if logging is enabled, otherwise
false
public void setCategory(String category)
category
- The categorypublic String getCategory()
public void setPrefix(String prefix)
prefix
- public String getPrefix()
public String getString(String resource)
resource
- the given resource
public String getString(String resource, Object param)
resource
- the given resourceparam
- a parameter
public String getString(String resource, Object param1, Object param2)
resource
- the given resourceparam1
- a parameterparam2
- a parameter
public String getString(String resource, Object[] params)
resource
- the given resourceparams
- an array of parameters
public void close()
public void logfine(String msg)
msg
- The message to log.public void logdebug(String msg)
true
,
otherwise an debug level message is logged. This is done for all used
loggers.
msg
- the message to logpublic void loginfo(String msg)
msg
- the message to logpublic void logwarn(String msg)
msg
- the message to logpublic void logerror(String msg)
msg
- the message to logpublic void logerror(String msg, Throwable error)
msg
- the message to logerror
- the Throwable to be loggedpublic void logfatal(String msg)
msg
- the message to logpublic void fine(String res)
res
- the resource used for the messagepublic void fine(String res, Object param)
res
- the resource used for the messageparam
- a parameter for the messagepublic void fine(String res, Object param1, Object param2)
res
- the resource used for the messageparam1
- a parameter for the messageparam2
- a parameter for the messagepublic void fine(String res, Object[] params)
res
- the resource used for the messageparams
- an array with parameters for the messagepublic void debug(String res)
true
, otherwise an info level message is logged. This is
done for all used loggers. The message is a NLS string formed using the
resource given.
res
- the resource used for the messagepublic void debug(String res, Object param)
true
, otherwise an info level message is logged. This is
done for all used loggers. The message is a NLS string formed using the
resource and includes a parameter.
res
- the resource used for the messageparam
- a parameter for the messagepublic void debug(String res, Object param1, Object param2)
true
, otherwise an info level message is logged. This is
done for all used loggers. The message is a NLS string formed using the
resource and includes two additional parameters.
res
- the resource used for the messageparam1
- a parameter for the messageparam2
- a parameter for the messagepublic void debug(String res, Object[] params)
true
, otherwise an info level message is logged. This is
done for all used loggers. The message is a NLS string formed using the
resource and includes array with parameters.
res
- the resource used for the messageparams
- an array with parameters for the messagepublic void info(String res)
res
- the resource used for the messagepublic void info(String res, Object param)
res
- the resource used for the messageparam
- a parameter for the messagepublic void info(String res, Object param1, Object param2)
res
- the resource used for the messageparam1
- a parameter for the messageparam2
- a parameter for the messagepublic void info(String res, Object[] params)
res
- the resource used for the messageparams
- an array with parameters for the messagepublic void warn(String res)
res
- the resource used for the messagepublic void warn(String res, Object param)
res
- the resource used for the messageparam
- a parameter for the messagepublic void warn(String res, Object param1, Object param2)
res
- the resource used for the messageparam1
- a parameter for the messageparam2
- a parameter for the messagepublic void warn(String res, Object[] params)
res
- the resource used for the messageparams
- an array with parameters for the messagepublic void error(String res)
res
- the resource used for the messagepublic void error(String res, Throwable error)
res
- the resource used for the messageerror
- the Throwable to be loggedpublic void error(String res, String param)
res
- the resource used for the messageparam
- a parameter for the messagepublic void error(String res, Object param, Throwable error)
res
- the resource used for the messageparam
- a parameter for the messageerror
- the Throwable to be loggedpublic void error(String res, String param1, String param2)
res
- the resource used for the messageparam1
- a parameter for the messageparam2
- a parameter for the messagepublic void error(String res, Object[] params)
res
- the resource used for the messageparams
- an array with parameters for the messagepublic void error(String res, Object[] params, Throwable error)
res
- the resource used for the messageparams
- an array with parameters for the messageerror
- the Throwable to be loggedpublic void fatal(String res)
res
- the resource used for the messagepublic void fatal(String res, Throwable err)
res
- the resource used for the messageerr
- the Throwable to be loggedpublic void fatal(String res, Object param)
res
- the resource used for the messageparam
- a parameter for the messagepublic void fatal(String res, Object param, Throwable err)
res
- the resource used for the messageparam
- a parameter for the messageerr
- the Throwable to be loggedpublic void fatal(String res, Object[] params)
res
- the resource used for the messageparams
- parameters for the messagepublic void log(String level, String msg)
level
- The level to use when loggingmsg
- The string to be loggedpublic void exception(String res) throws Exception
res
- the resource used for the message
Exception
- the thrown exceptionpublic void exception(String res, Object param) throws Exception
res
- the resource used for the messageparam
- a parameter for the message
Exception
- the thrown exceptionpublic void exception(String res, Object param1, Object param2) throws Exception
res
- the resource used for the messageparam1
- a parameter for the messageparam2
- a parameter for the message
Exception
- the thrown exceptionpublic void exception(String res, Object[] params) throws Exception
res
- the resource used for the messageparams
- parameters for the message
Exception
- the thrown exceptionpublic void dumpEntry(Entry e)
e
- The entry to dumpdump(java.lang.Object)
public void dump(Object o)
o
- The entry to dumpdumpEntry(com.ibm.di.entry.Entry)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |