public class Logger
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
debug(java.lang.Object msg)
Log a DEBUG message.
|
void |
debug(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
void |
error(java.lang.Object msg)
Log a ERROR message.
|
void |
error(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
void |
fatal(java.lang.Object msg)
Log a FATAL message.
|
void |
fatal(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
static Logger |
getLogger(java.lang.Class<?> clazz)
Find or create a logger for the specified class.
|
static Logger |
getLogger(java.lang.String name)
Find or create a logger for a named subsystem.
|
void |
info(java.lang.Object msg)
Log a INFO message.
|
void |
info(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
boolean |
isDebugEnabled()
Check if a message with a DEBUG level would actually be logged by this
logger.
|
boolean |
isInfoEnabled()
Check if a message with an INFO level would actually be logged by this
logger.
|
boolean |
isTraceEnabled()
Check if a message with a TRACE level would actually be logged by this
logger.
|
void |
logEntry()
Logs an entry in the calling method.
|
void |
logExit()
Logs exiting the calling method
|
void |
reset()
Reinitialize the logging properties and reread the logging configuration.
|
void |
setLevelAll()
Set logging level for all handlers to ALL (allow all log messages)
|
void |
setLevelDebug()
Set logging level for all handlers to DEBUG
|
void |
setLevelError()
Set logging level for all handlers to ERROR
|
void |
setLevelFatal()
Set logging level for all handlers to FATAL
|
void |
setLevelInfo()
Set logging level for all handlers to INFO
|
void |
setLevelOff()
Set logging level for all handlers to OFF (allow no log messages)
|
void |
setLevelTrace()
Set logging level for all handlers to TRACE
|
void |
setLevelWarn()
Set logging level for all handlers to WARNING
|
void |
trace(java.lang.Object msg)
Log a TRACE message.
|
void |
trace(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
void |
warn(java.lang.Object msg)
Log a WARN message.
|
void |
warn(java.lang.Object msg,
java.lang.Throwable t)
Log a message, with associated Throwable information.
|
public static Logger getLogger(java.lang.Class<?> clazz) throws java.lang.NullPointerException
If a new logger is created its log level will be configured based on the logging configuration and it will be configured to also send logging output to its parent's handlers.
clazz
- The creating class.
java.lang.NullPointerException
- if the name is null.public static Logger getLogger(java.lang.String name) throws java.lang.NullPointerException
If a new logger is created its log level will be configured based on the logging configuration and it will be configured to also send logging output to its parent's handlers.
name
- A name for the logger. This should be a dot-separated name
and should normally be based on the class name of the creator, such as
"net.java.sip.communicator.MyFunnyClass"
java.lang.NullPointerException
- if the name is null.public void logEntry()
public void logExit()
public boolean isTraceEnabled()
public void trace(java.lang.Object msg)
If the logger is currently enabled for the TRACE message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void trace(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public boolean isDebugEnabled()
public void debug(java.lang.Object msg)
If the logger is currently enabled for the DEBUG message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void debug(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public boolean isInfoEnabled()
public void info(java.lang.Object msg)
If the logger is currently enabled for the INFO message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void info(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void warn(java.lang.Object msg)
If the logger is currently enabled for the WARN message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void warn(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void error(java.lang.Object msg)
If the logger is currently enabled for the ERROR message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void error(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void fatal(java.lang.Object msg)
If the logger is currently enabled for the FATAL message level then the given message is forwarded to all the registered output Handler objects.
msg
- The message to logpublic void fatal(java.lang.Object msg, java.lang.Throwable t)
msg
- The message to logt
- Throwable associated with log message.public void setLevelFatal()
public void setLevelError()
public void setLevelWarn()
public void setLevelInfo()
public void setLevelDebug()
public void setLevelTrace()
public void setLevelAll()
public void setLevelOff()
public void reset()
The same rules are used for locating the configuration properties as are used at startup. So if the properties containing the log dir locations have changed, we would read the new configuration.
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.