Version: 9.4.5.v20170502 |
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 for sponsored feature development
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 frameworks operate.
Jetty logging, however, has a slightly different set of levels that it uses internally:
Note
Jetty logging produces no FATAL or SEVERE events.
Configure the Jetty logging layer via the org.eclipse.jetty.util.log.Log
class, following these rules.
Load Properties
jetty-logging.properties
(if found).System.getProperties()
.Determine the log implementation.
org.eclipse.jetty.util.log.class
is defined, load the class it defines as the logger implementation from the server classpath
.org.slf4j.Logger
exists in server classpath, the Jetty implementation becomes org.eclipse.jetty.util.log.Slf4jLog
.org.eclipse.jetty.util.log.StdErrLog
.Note
You can create your own custom logging by providing an implementation of the Jetty Logger API. For an example of a custom logger, see JavaUtilLog.java.
By default, the internal Jetty Logging discovery mechanism will load logging specific properties from a classpath resource called jetty-logging.properties
and then initialize the Logging from a combination of properties found in that file, along with any System Properties.
A typical jetty-logging.properties file will include at least the declaration of which logging implementation you want to use by defining a value for the org.eclipse.jetty.util.log.class
property.
Examples for various logging frameworks can be found later in this documentation.