@MessageLogger(projectCode="ISPN")
public interface Log
extends org.jboss.logging.BasicLogger
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(String methodName,
String exceptionName,
Throwable t) |
void |
propertyCouldNotBeReplaced(String line) |
CacheConfigurationException |
sslInitializationException(Throwable e) |
void |
unableToConvertStringPropertyToBoolean(String value,
boolean defaultValue) |
void |
unableToConvertStringPropertyToInt(String value,
int defaultValue) |
void |
unableToConvertStringPropertyToLong(String value,
long defaultValue) |
void |
unableToLoadClass(String classname,
String classloaders,
Throwable cause) |
void |
unableToSetValue(Exception e) |
IllegalArgumentException |
unableToUnwrap(Object o,
Class<?> clazz) |
debug, debug, debug, debug, debugf, debugf, debugf, debugf, debugf, debugf, debugf, debugf, debugv, debugv, debugv, debugv, debugv, debugv, debugv, debugv, error, error, error, error, errorf, errorf, errorf, errorf, errorf, errorf, errorf, errorf, errorv, errorv, errorv, errorv, errorv, errorv, errorv, errorv, fatal, fatal, fatal, fatal, fatalf, fatalf, fatalf, fatalf, fatalf, fatalf, fatalf, fatalf, fatalv, fatalv, fatalv, fatalv, fatalv, fatalv, fatalv, fatalv, info, info, info, info, infof, infof, infof, infof, infof, infof, infof, infof, infov, infov, infov, infov, infov, infov, infov, infov, isDebugEnabled, isEnabled, isInfoEnabled, isTraceEnabled, log, log, log, log, logf, logf, logf, logf, logf, logf, logf, logf, logf, logf, logf, logf, logv, logv, logv, logv, logv, logv, logv, logv, logv, logv, logv, logv, trace, trace, trace, trace, tracef, tracef, tracef, tracef, tracef, tracef, tracef, tracef, tracev, tracev, tracev, tracev, tracev, tracev, tracev, tracev, warn, warn, warn, warn, warnf, warnf, warnf, warnf, warnf, warnf, warnf, warnf, warnv, warnv, warnv, warnv, warnv, warnv, warnv, warnv
@LogMessage(level=) @Message(value="Property %s could not be replaced as intended!", id=901) void propertyCouldNotBeReplaced(String line)
@LogMessage(level=) @Message(value="Invocation of %s threw an exception %s. Exception is ignored.", id=902) void ignoringException(String methodName, String exceptionName, @Cause Throwable t)
@LogMessage(level=) @Message(value="Unable to set value!", id=903) void unableToSetValue(@Cause Exception e)
@Message(value="Error while initializing SSL context", id=904) CacheConfigurationException sslInitializationException(@Cause Throwable e)
@LogMessage(level=) @Message(value="Unable to load %s from any of the following classloaders: %s", id=905) void unableToLoadClass(String classname, String classloaders, @Cause Throwable cause)
@LogMessage(level=) @Message(value="Unable to convert string property [%s] to an int! Using default value of %d", id=906) void unableToConvertStringPropertyToInt(String value, int defaultValue)
@LogMessage(level=) @Message(value="Unable to convert string property [%s] to a long! Using default value of %d", id=907) void unableToConvertStringPropertyToLong(String value, long defaultValue)
@LogMessage(level=) @Message(value="Unable to convert string property [%s] to a boolean! Using default value of %b", id=908) void unableToConvertStringPropertyToBoolean(String value, boolean defaultValue)
@Message(value="Unwrapping %s to a type of %s is not a supported", id=909) IllegalArgumentException unableToUnwrap(Object o, Class<?> clazz)
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.