public class Logger
extends com.avaya.common.logging.client.ExtendedCommonLogger
Avaya Breeze generally runs at the INFO level. This means that any log at level INFO or higher (INFO, WARN, ERROR, FATAL) would be logged by default. When running at the INFO level, logs of FINE, FINER, or FINEST will not appear in the log files. In a normal run state, logs should be rare, for example to indicate that the service initialized correctly or to log significant events. The log level can be changed while running, so that logging provides increasingly more information.
The log methods are generally invoked with a String message to be logged. The methods also take a Throwable, which will cause the stack trace to be added to the log.
Example:try { // some code that can throw an exception } catch (final Exception e) { logger.error("Caught exception trying to calculate x: ", e); }This class is a wrapper on the log4j logger. The log4j.properties file can be found under /opt/Avaya/Common/conf/ on Avaya Breeze.
Modifier and Type | Method and Description |
---|---|
void |
error(Object message)
This method logs a message at the ERROR level.
|
void |
error(Object message,
Throwable throwable)
This method logs a message at the ERROR level and adds the stack trace for the Throwable.
|
void |
fatal(Object message)
This method logs a message at the FATAL level.
|
void |
fatal(Object message,
Throwable throwable)
This method logs a message at the FATAL level and adds the stack trace for the Throwable.
|
void |
fine(Object message)
This method logs a message at the FINE level.
|
void |
fine(Object message,
Throwable throwable)
This method logs a message at the FINE level and adds the stack trace for the Throwable.
|
void |
finer(Object message)
This method logs a message at the FINER level.
|
void |
finer(Object message,
Throwable throwable)
This method logs a message at the FINER level and adds the stack trace for the Throwable.
|
void |
finest(Object message)
This method logs a message at the FINEST level.
|
void |
finest(Object message,
Throwable throwable)
This method logs a message at the FINEST level and adds the stack trace for the Throwable.
|
static Logger |
getLogger(Class classInstance)
This methods returns a service-specific Logger for the calling service.
|
static Logger |
getLogger(String serviceName)
This methods returns a Logger for the requested service.
|
void |
info(Object message)
This method logs a message at the INFO level.
|
void |
info(Object message,
Throwable throwable)
This method logs a message at the INFO level and adds the stack trace for the Throwable.
|
boolean |
isFineEnabled()
This method returns whether the FINE level is enabled.
|
boolean |
isFinerEnabled()
This method returns whether the FINER level is enabled.
|
boolean |
isFinestEnabled()
This method returns whether the FINEST level is enabled.
|
boolean |
isInfoEnabled()
This method returns whether the INFO level is enabled.
|
void |
logEvent(String eventId,
Object[] argument)
Logs an event, which will be converted into an alarm by CE.
|
void |
setPrefix(String prefix) |
void |
warn(Object message)
This method logs a message at the WARN level.
|
void |
warn(Object message,
Throwable throwable)
This method logs a message at the WARN level, and adds the stack trace for the Throwable.
|
addAppender, getAllAppenders, getAppender, getHostname, getInstanceHostname, getInstanceLogProductType, getInstanceProcessId, getInstanceProcessName, getInstanceTimeZone, getLogger, getLogger, getLogProductType, getProcessId, getProcessName, getRootLogger, getTimeZone, isEnabledFor, logEvent, logEvent, removeAppender, setAdditivity, setHostname, setInstanceHostname, setInstanceLogProductType, setInstanceProcessId, setInstanceProcessName, setInstanceTimeZone, setLevel, setLogProductType, setProcessId, setProcessName, setTimeZone
public Logger(String loggerType)
public static Logger getLogger(Class classInstance)
classInstance
- The class for the logger.public static Logger getLogger(String serviceName)
getLogger(Class classInstance)
method.serviceName
- The name of the servicepublic void error(Object message)
error
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void error(Object message, Throwable throwable)
error
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.throwable
- Throwable to be logged.public void fatal(Object message)
fatal
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void fatal(Object message, Throwable throwable)
fatal
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.throwable
- Throwable to be logged.public void fine(Object message)
fine
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void fine(Object message, Throwable throwable)
fine
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.throwable
- Throwable to be loggedpublic void finer(Object message)
finer
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void finer(Object message, Throwable throwable)
finer
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.throwable
- Throwable to be loggedpublic void finest(Object message)
finest
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void finest(Object message, Throwable throwable)
finest
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.throwable
- Throwable to be loggedpublic void info(Object message)
info
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void info(Object message, Throwable throwable)
info
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.throwable
- Throwable to be loggedpublic void warn(Object message, Throwable throwable)
warn
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public void warn(Object message)
warn
in class com.avaya.common.logging.client.Logger
message
- Message to be logged.public boolean isFineEnabled()
isFineEnabled
in class com.avaya.common.logging.client.Logger
public boolean isFinerEnabled()
isFinerEnabled
in class com.avaya.common.logging.client.Logger
public boolean isFinestEnabled()
isFinestEnabled
in class com.avaya.common.logging.client.Logger
public boolean isInfoEnabled()
isInfoEnabled
in class com.avaya.common.logging.client.Logger
public final void logEvent(String eventId, Object[] argument)
eventId
- Event code which maps to an alarm defined in the alarms.xml file.argument
- The arguments associated with this eventpublic void setPrefix(String prefix)
Copyright © 2016 Avaya. All Rights Reserved.