Reputation: 55
i am currently try to configure centralized logging for jetty 8 with slf4j. I found the following [tutorial][1] but it seems not to work with jetty 8. Does someone knows how to do this with jetty 8?
Solution:
jetty-webapp-logging.xml must have the following content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<!-- =============================================================== -->
<!-- Enable Centralized Logging in the Jetty Server -->
<!-- =============================================================== -->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Ref id="DeploymentManager">
<Call name="addLifeCycleBinding">
<Arg>
<New class="org.mortbay.jetty.webapp.logging.CentralizedWebAppLoggingBinding">
</New>
</Arg>
</Call>
</Ref>
</Configure>
Upvotes: 1
Views: 3035
Reputation: 49462
While the the tutorial, Centralized Logging with Logback, was created for Jetty 9, all of the features it is using is available as well on Jetty 8.1.10.
Some advice:
start.jar
are the same.start.ini
changes are the same.Finally, various logging examples can be found at
https://github.com/jetty-project/jetty-and-logback-example
(tip: build the maven projects then look in the various ${module}/target/jetty-distro/
for the configured distribution that these maven builds produce)
Upvotes: 1