The documentation is correct because the term "Java Logging Framework" is often associated with modern logging frameworks such as java.util.logging, slf4j, logback, log4j, commons-logging, logkit, etc.
That's right, Jetty doesn't use them.
Launching moorings precedes all of these efforts in a standardized logging framework. (Jetty, and its registration level was created in 1995)
This is what Jetty logs (and is documented on the documentation site) regarding setup and configuration.
Default behavior:
- If slf4j is present in your classpath, it will generate logging events in slf4j for processing using Slf4jLog .
- Return to StdErrLog , emitting in System.err.
To configure:
- Specify the logging version that you want to use. Possible options:
This can be done in three different ways.
- Using a system property to set logging impl
- Using
jetty-logging.properties self-discovery / configuration found from classpath.
An example from the pier project itself :
- Using code to install
Log.setLog(Logger)
This is especially useful for those using embedded-jetty.
import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.StdErrLog; Log.setLog(new StdErrLog());
Tips and notes:
The startup output of your Jetty server will give you hints about the implementation of the protocol that it uses.
Normal / default behavior:
2014-09-11 10:48:38.726:INFO::main: Logging initialized @378ms 2014-09-11 10:48:39.067:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:/Users/joakim/Code/Jetty/distros/jetty-distribution-9.2.1.v20140609/demo-base/webapps/] at interval 1
Note that it does not have a namespace declaration or a greatly reduced namespace. This tells me that StdErrLog is being used.
If using slf4j:
10:50:18.871 [main] INFO org.eclipse.jetty.util.log - Logging initialized @352ms 10:50:19.102 [main] INFO oejdpScanningAppProvider - Deployment monitor [file:/Users/joakim/Code/Jetty/distros/jetty-distribution-9.2.1.v20140609/demo-base/webapps/] at interval 1
This is the default appender console for slf4j - slf4j logback . The general structure here is very different from what StdErrLog , so I can now say that the pier emits an implementation of Slf4jLog .