private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery
Table of Contents
This chapter discusses various options for configuring logging.
Jetty provides logging via its own
org.eclipse.jetty.util.log.Logger layer, and does not natively
use any existing Java logging framework. All logging events, produced via
the Jetty logging layer, have a name, a level, and a message. The name is a
FQCN (fully qualified class name) similar to how all existing Java logging
Jetty logging, however, has a slightly different set of levels that it uses internally:
For events serious enough to inform and log, but not fatal.
Debugging events (very noisy)
Exception events that you can safely ignore, but useful for some people. You might see this level as DEBUG under some Java logging framework configurations, where its retain the ignore phrase somewhere in the logging).
Jetty Logging produces no FATAL or SEVERE events.
Configure the Jetty logging layer via the
org.eclipse.jetty.util.log.Log class, following these
First from a Classpath Resource called
jetty-logging.properties (if found).
Then from the
Determine the Log implementation.
defined, load the class it defines as the Logger implementation
from the server classpath.
If the class
org.slf4j.Logger exists in server
classpath, the Jetty implementation becomes
If no logger implementation is specified, default to
If you select the default Jetty logger (StdErrLog), you can then use further properties (either as System properties or in a jetty-logging.properties as outlined in Selecting the Log Framework) to control event levels to log and to adjust the format of those logs.
Table 9.1. Logging Parameters
|Sets the logging level for all loggers within the
|Logger specific, attempts to print the Java source file name and line number from where the logging event originated. Name must be a fully qualified class name (package name hierarchy is not supported by this configurable). Default is false. Be aware that this is a slow operation and has an impact on performance!|
|Logger specific, controls the display of stacktraces. Name must be a fully qualified class name (package name hierarchy is not supported by this configurable). Default is true.|
|If set to true, exceptions that have been recorded as
ignored with the |
|Special Global Configuration. Attempts to print the Java source file name and line number from where the logging event originated. Default is false.|
|Special Global Configuration. When true, outputs logging events to STDERR using long form, fully qualified class names. When false, uses abbreviated package names. Default is false.|
|These are deprecated properties from older Jetty versions that are now ignored with a warning if used.|
# Set up logging implementation org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog org.eclipse.jetty.LEVEL=INFO # Make websocket more verbose for testing org.eclipse.jetty.websocket.LEVEL=DEBUG
This sets the Logging Implementation to StdErrLog.
Configures the logging level for
org.eclipse.jetty" to be
Configures the logging level for
org.eclipse.jetty.websocket" to be
<Call class="org.eclipse.jetty.util.log.Log" name="getRootLogger"> <Call name="setDebugEnabled"> <Arg type="boolean">true</Arg> </Call> </Call>
This technique, from older versions of Jetty, is used to configure all of the StdErrLog loggers (no other implementations support this) to be logging at DEBUG level.
See an error or something missing? Contribute to this documentation at Github!