public interface Log
Log log = LogFactory.getLog( getClass() );
The above will get
you an instance of Log, which can be used to generate log messages
either via JBoss Logging which then can delegate to Log4J (if the libraries
are present) or (if not) the built-in JDK logger.
In addition to the 6 log levels available, this framework also supports
parameter interpolation, similar to the JDKs String.format(String, Object...)
method. What this means is, that the following block:
if (log.isTraceEnabled()) { log.trace("This is a message " + message + " and some other value is " + value); }
... could be replaced with ...
if (log.isTraceEnabled()) log.tracef("This is a message %s and some other value is %s", message, value);
This greatly enhances code readability.
If you are passing a Throwable, note that this should be passed in
before the vararg parameter list.
Modifier and Type | Method and Description |
---|---|
void |
ignoringException(java.lang.String methodName,
java.lang.String exceptionName,
java.lang.Throwable t) |
void |
propertyCouldNotBeReplaced(java.lang.String line) |
CacheConfigurationException |
sslInitializationException(java.lang.Throwable e) |
void |
unableToConvertStringPropertyToBoolean(java.lang.String value,
boolean defaultValue) |
void |
unableToConvertStringPropertyToInt(java.lang.String value,
int defaultValue) |
void |
unableToConvertStringPropertyToLong(java.lang.String value,
long defaultValue) |
void |
unableToLoadClass(java.lang.String classname,
java.lang.String classloaders,
java.lang.Throwable cause) |
void |
unableToSetValue(java.lang.Exception e) |
java.lang.IllegalArgumentException |
unableToUnwrap(java.lang.Object o,
java.lang.Class<?> clazz) |
void propertyCouldNotBeReplaced(java.lang.String line)
void ignoringException(java.lang.String methodName, java.lang.String exceptionName, java.lang.Throwable t)
void unableToSetValue(java.lang.Exception e)
CacheConfigurationException sslInitializationException(java.lang.Throwable e)
void unableToLoadClass(java.lang.String classname, java.lang.String classloaders, java.lang.Throwable cause)
void unableToConvertStringPropertyToInt(java.lang.String value, int defaultValue)
void unableToConvertStringPropertyToLong(java.lang.String value, long defaultValue)
void unableToConvertStringPropertyToBoolean(java.lang.String value, boolean defaultValue)
java.lang.IllegalArgumentException unableToUnwrap(java.lang.Object o, java.lang.Class<?> clazz)