| Method from org.jboss.web.tomcat.Log4jLogger Detail: |
public void addPropertyChangeListener(PropertyChangeListener listener) {
support.addPropertyChangeListener(listener);
}
Add a property change listener to this component. |
public Container getContainer() {
return container;
}
Return the Container with which this Logger has been associated. |
public String getInfo() {
return getClass().getName();
}
Return descriptive information about this Logger implementation and
the corresponding version number, in the format
<description>/<version>. |
public int getVerbosity() {
return this.verbosity;
}
Return the verbosity level of this logger. Messages logged with a
higher verbosity than this level will be silently ignored. |
public void log(String message) {
log.info(message);
}
Writes the specified message to a servlet log file, usually an event
log. The name and type of the servlet log is specific to the
servlet container. This message will be logged unconditionally. |
public void log(Exception exception,
String message) {
log.error(message, exception);
}
Writes the specified exception, and message, to a servlet log file.
The implementation of this method should call
log(msg, exception) instead. This method is deprecated
in the ServletContext interface, but not deprecated here to avoid
many useless compiler warnings. This message will be logged
unconditionally. |
public void log(String message,
int verbosity) {
switch( verbosity )
{
case FATAL:
log.fatal(message);
break;
case ERROR:
log.error(message);
break;
case WARNING:
log.warn(message);
break;
case INFORMATION:
log.info(message);
break;
case DEBUG:
log.debug(message);
break;
}
}
Writes the specified message to the servlet log file, usually an event
log, if the logger is set to a verbosity level equal to or higher than
the specified value for this message. |
public void log(String message,
Throwable throwable) {
Throwable rootCause = null;
if (throwable instanceof LifecycleException)
rootCause = ((LifecycleException) throwable).getThrowable();
else if (throwable instanceof ServletException)
rootCause = ((ServletException) throwable).getRootCause();
log.error(message, throwable);
if( rootCause != null )
{
log.error("----- Root Cause -----", rootCause);
}
}
Writes an explanatory message and a stack trace for a given
Throwable exception to the servlet log file. The name
and type of the servlet log file is specific to the servlet container,
usually an event log. This message will be logged unconditionally. |
public void log(String message,
Throwable throwable,
int verbosity) {
switch( verbosity )
{
case FATAL:
log.fatal(message, throwable);
break;
case ERROR:
log.error(message, throwable);
break;
case WARNING:
log.warn(message, throwable);
break;
case INFORMATION:
log.info(message, throwable);
break;
case DEBUG:
log.debug(message, throwable);
break;
}
}
Writes the specified message and exception to the servlet log file,
usually an event log, if the logger is set to a verbosity level equal
to or higher than the specified value for this message. |
public void removePropertyChangeListener(PropertyChangeListener listener) {
support.removePropertyChangeListener(listener);
}
Remove a property change listener from this component. |
public void setCategory(String category) {
log = Logger.getLogger(category);
}
Allow the log category to be set from the config category attribute |
public void setContainer(Container container) {
Container oldContainer = this.container;
this.container = container;
support.firePropertyChange("container", oldContainer, this.container);
}
Set the Container with which this Logger has been associated. |
public void setVerbosity(int verbosity) {
this.verbosity = verbosity;
}
Set the verbosity level of this logger. Messages logged with a
higher verbosity than this level will be silently ignored. |
public void setVerbosityLevel(String verbosity) {
if ("FATAL".equalsIgnoreCase(verbosity))
this.verbosity = FATAL;
else if ("ERROR".equalsIgnoreCase(verbosity))
this.verbosity = ERROR;
else if ("WARNING".equalsIgnoreCase(verbosity))
this.verbosity = WARNING;
else if ("INFORMATION".equalsIgnoreCase(verbosity))
this.verbosity = INFORMATION;
else if ("DEBUG".equalsIgnoreCase(verbosity))
this.verbosity = DEBUG;
else
{
log.warn("Unknown log level '"+verbosity+"' seen, using DEBUG\n"
+ "Valid values are: FATAL, ERROR, WARNING, INFORMATION or DEBUG");
this.verbosity = DEBUG;
}
}
|