public interface LoggerFacade
For trace, error, etc logging to the console, files, etc.
Type Params | Return Type | Name and description |
---|---|---|
|
public void |
debug(java.lang.String message) |
|
public void |
debug(java.lang.String message, java.lang.Throwable thrown) |
|
public void |
error(java.lang.String message) |
|
public void |
error(java.lang.String message, java.lang.Throwable thrown) |
|
public void |
info(java.lang.String message) |
|
public void |
info(java.lang.String message, java.lang.Throwable thrown) |
|
public void |
log(int level, java.lang.String message, java.lang.Throwable thrown) Log a message and/or Throwable error at the given level. |
|
public boolean |
logEnabled(int level) Is the given logging level enabled? |
|
public void |
trace(java.lang.String message) |
|
public void |
trace(java.lang.String message, java.lang.Throwable thrown) |
|
public void |
warn(java.lang.String message) |
|
public void |
warn(java.lang.String message, java.lang.Throwable thrown) |
Log a message and/or Throwable error at the given level.
This is meant to be used for scripts, xml-actions, etc.
In Java or Groovy classes it is better to use SLF4J directly, with something like:
public class Wombat {
final static org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Wombat.class);
public void setTemperature(Integer temperature) {
Integer oldT = t;
Integer t = temperature;
logger.debug("Temperature set to {}. Old temperature was {}.", t, oldT);
if(temperature.intValue() > 50) {
logger.info("Temperature has risen above 50 degrees.");
}
}
}
level
- The logging level. Options should come from org.apache.log4j.Level.message
- The message text to log. If contains \${} syntax will be expanded from the current context.thrown
- Throwable with stack trace, etc to be logged along with the message.Is the given logging level enabled?