|
|
|
@ -0,0 +1,425 @@
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// Copyright (c) 1995-2016 Mort Bay Consulting Pty. Ltd.
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// All rights reserved. This program and the accompanying materials
|
|
|
|
|
// are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
|
// and Apache License v2.0 which accompanies this distribution.
|
|
|
|
|
//
|
|
|
|
|
// The Eclipse Public License is available at
|
|
|
|
|
// http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
//
|
|
|
|
|
// The Apache License v2.0 is available at
|
|
|
|
|
// http://www.opensource.org/licenses/apache2.0.php
|
|
|
|
|
//
|
|
|
|
|
// You may elect to redistribute this code under either of these licenses.
|
|
|
|
|
// ========================================================================
|
|
|
|
|
|
|
|
|
|
[[configuring-logging-modules]]
|
|
|
|
|
=== Jetty Logging Integrations (Slf4j, Log4j, Logback, JCL, JUL)
|
|
|
|
|
|
|
|
|
|
Jetty provides support for several logging frameworks including SLF4J, Java Commons Logging (jcl), Java Util Logging (jul), Log4j (including version 2), and Logback.
|
|
|
|
|
This page includes examples of how to enable the associated modules for these different frameworks.
|
|
|
|
|
Enabling these frameworks in the Jetty distribution is as easy as activating any other module, by adding `--add-to-start=<module name>` to the start command for your server, such as:
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-jetty
|
|
|
|
|
INFO : logging-jetty initialized in ${jetty.base}/start.d/logging-jetty.ini
|
|
|
|
|
INFO : resources transitive
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
....
|
|
|
|
|
|
|
|
|
|
As noted above, Jetty supports a wide array of logging technologies.
|
|
|
|
|
The release of Jetty 9.4 made the implementation of these frameworks easier by providing logging modules that contain all the dependencies needed to implement a specific technology.
|
|
|
|
|
If a particular logging framework requires additional jar files, Jetty will automatically download these as part of enabling the associated module.
|
|
|
|
|
You can view a list of all the Jetty modules by running `java -jar <path-to-jetty.home>/start.jar --list-modules`.
|
|
|
|
|
|
|
|
|
|
[[example-logging-slf4j]]
|
|
|
|
|
==== Logging with SLF4J
|
|
|
|
|
|
|
|
|
|
===== jetty-slf4j
|
|
|
|
|
|
|
|
|
|
Jetty uses the Slf4j api as a bridge to provide logging information to additional frameworks such as Log4j or Logback.
|
|
|
|
|
It can also be used itself to provide logging in conjunction with standard Jetty logging.
|
|
|
|
|
To enable the Slf4j framework, you need to activate the `logging-slf4j` module.
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-slf4j
|
|
|
|
|
|
|
|
|
|
ALERT: There are enabled module(s) with licenses.
|
|
|
|
|
The following 1 module(s):
|
|
|
|
|
+ contains software not provided by the Eclipse Foundation!
|
|
|
|
|
+ contains software not covered by the Eclipse Public License!
|
|
|
|
|
+ has not been audited for compliance with its license
|
|
|
|
|
|
|
|
|
|
Module: slf4j-api
|
|
|
|
|
+ SLF4J is distributed under the MIT License.
|
|
|
|
|
+ Copyright (c) 2004-2013 QOS.ch
|
|
|
|
|
+ All rights reserved.
|
|
|
|
|
+ Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
|
+ a copy of this software and associated documentation files (the
|
|
|
|
|
+ "Software"), to deal in the Software without restriction, including
|
|
|
|
|
+ without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
+ distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
+ permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
+ the following conditions:
|
|
|
|
|
+ The above copyright notice and this permission notice shall be
|
|
|
|
|
+ included in all copies or substantial portions of the Software.
|
|
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
|
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
|
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
|
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
|
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
|
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
Proceed (y/N)? y
|
|
|
|
|
INFO : slf4j-api transitive, ini template available with --add-to-start=slf4j-api
|
|
|
|
|
INFO : logging-slf4j initialized in ${jetty.base}/start.d/logging-slf4j.ini
|
|
|
|
|
INFO : slf4j-impl transitive
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-api-1.7.21.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-simple/1.7.21/slf4j-simple-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-simple-1.7.21.jar
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
|
|
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── lib
|
|
|
|
|
│ └── slf4j
|
|
|
|
|
│ ├── slf4j-api-1.7.21.jar
|
|
|
|
|
│ └── slf4j-simple-1.7.21.jar
|
|
|
|
|
└── start.d
|
|
|
|
|
├── logging-slf4j.ini
|
|
|
|
|
....
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[example-logging-log4j]]
|
|
|
|
|
==== Logging with Log4j and log4j2
|
|
|
|
|
|
|
|
|
|
It is possible to have the Jetty Server logging configured so that Log4j or Log4j2 controls the output of logging events produced by Jetty.
|
|
|
|
|
This is accomplished by configuring Jetty for logging to http://logging.apache.org/log4j/[Apache Log4j] via http://slf4j.org/manual.html[Slf4j] and the http://slf4j.org/manual.html#swapping[Slf4j binding layer for Log4j].
|
|
|
|
|
Implementation of Log4j can be done by enabling the `logging-log4j` module.
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-log4j
|
|
|
|
|
|
|
|
|
|
ALERT: There are enabled module(s) with licenses.
|
|
|
|
|
The following 2 module(s):
|
|
|
|
|
+ contains software not provided by the Eclipse Foundation!
|
|
|
|
|
+ contains software not covered by the Eclipse Public License!
|
|
|
|
|
+ has not been audited for compliance with its license
|
|
|
|
|
|
|
|
|
|
Module: log4j-impl
|
|
|
|
|
+ Log4j is released under the Apache 2.0 license.
|
|
|
|
|
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
|
|
|
|
|
|
Module: slf4j-api
|
|
|
|
|
+ SLF4J is distributed under the MIT License.
|
|
|
|
|
+ Copyright (c) 2004-2013 QOS.ch
|
|
|
|
|
+ All rights reserved.
|
|
|
|
|
+ Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
|
+ a copy of this software and associated documentation files (the
|
|
|
|
|
+ "Software"), to deal in the Software without restriction, including
|
|
|
|
|
+ without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
+ distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
+ permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
+ the following conditions:
|
|
|
|
|
+ The above copyright notice and this permission notice shall be
|
|
|
|
|
+ included in all copies or substantial portions of the Software.
|
|
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
|
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
|
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
|
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
|
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
|
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
Proceed (y/N)? y
|
|
|
|
|
INFO : slf4j-api transitive, ini template available with --add-to-start=slf4j-api
|
|
|
|
|
INFO : log4j-impl transitive, ini template available with --add-to-start=log4j-impl
|
|
|
|
|
INFO : resources transitive
|
|
|
|
|
INFO : slf4j-log4j transitive
|
|
|
|
|
INFO : logging-log4j initialized in ${jetty.base}/start.d/logging-log4j.ini
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-api-1.7.21.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/log4j/log4j/1.2.17/log4j-1.2.17.jar to ${jetty.base}/lib/log4j/log4j-1.2.17.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-log4j12/1.7.21/slf4j-log4j12-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-log4j12-1.7.21.jar
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
|
|
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── lib
|
|
|
|
|
│ ├── log4j
|
|
|
|
|
│ │ └── log4j-1.2.17.jar
|
|
|
|
|
│ └── slf4j
|
|
|
|
|
│ ├── slf4j-api-1.7.21.jar
|
|
|
|
|
│ └── slf4j-log4j12-1.7.21.jar
|
|
|
|
|
├── resources
|
|
|
|
|
│ └── log4j.properties
|
|
|
|
|
└── start.d
|
|
|
|
|
├── logging-log4j.ini
|
|
|
|
|
....
|
|
|
|
|
|
|
|
|
|
Or, to enable Log4j2, simply enable the `logging-log4j2` module.
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-log4j2
|
|
|
|
|
|
|
|
|
|
ALERT: There are enabled module(s) with licenses.
|
|
|
|
|
The following 2 module(s):
|
|
|
|
|
+ contains software not provided by the Eclipse Foundation!
|
|
|
|
|
+ contains software not covered by the Eclipse Public License!
|
|
|
|
|
+ has not been audited for compliance with its license
|
|
|
|
|
|
|
|
|
|
Module: log4j2-api
|
|
|
|
|
+ Log4j is released under the Apache 2.0 license.
|
|
|
|
|
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
|
|
|
|
|
|
Module: slf4j-api
|
|
|
|
|
+ SLF4J is distributed under the MIT License.
|
|
|
|
|
+ Copyright (c) 2004-2013 QOS.ch
|
|
|
|
|
+ All rights reserved.
|
|
|
|
|
+ Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
|
+ a copy of this software and associated documentation files (the
|
|
|
|
|
+ "Software"), to deal in the Software without restriction, including
|
|
|
|
|
+ without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
+ distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
+ permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
+ the following conditions:
|
|
|
|
|
+ The above copyright notice and this permission notice shall be
|
|
|
|
|
+ included in all copies or substantial portions of the Software.
|
|
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
|
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
|
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
|
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
|
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
|
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
Proceed (y/N)? y
|
|
|
|
|
INFO : slf4j-api transitive, ini template available with --add-to-start=slf4j-api
|
|
|
|
|
INFO : logging-log4j2 initialized in ${jetty.base}/start.d/logging-log4j2.ini
|
|
|
|
|
INFO : log4j2-api transitive, ini template available with --add-to-start=log4j2-api
|
|
|
|
|
INFO : resources transitive
|
|
|
|
|
INFO : slf4j-log4j2 transitive
|
|
|
|
|
INFO : log4j2-impl transitive
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-api-1.7.21.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/apache/logging/log4j/log4j-api/2.6.1/log4j-api-2.6.1.jar to ${jetty.base}/lib/log4j/log4j-api-2.6.1.jar
|
|
|
|
|
MKDIR: ${jetty.base}/resources
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/apache/logging/log4j/log4j-slf4j-impl/2.6.1/log4j-slf4j-impl-2.6.1.jar to ${jetty.base}/lib/log4j/log4j-slf4j-impl-2.6.1.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.6.1/log4j-core-2.6.1.jar to ${jetty.base}/lib/log4j/log4j-core-2.6.1.jar
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
|
|
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── lib
|
|
|
|
|
│ ├── log4j
|
|
|
|
|
│ │ ├── log4j-api-2.6.1.jar
|
|
|
|
|
│ │ ├── log4j-core-2.6.1.jar
|
|
|
|
|
│ │ └── log4j-slf4j-impl-2.6.1.jar
|
|
|
|
|
│ └── slf4j
|
|
|
|
|
│ └── slf4j-api-1.7.21.jar
|
|
|
|
|
├── resources
|
|
|
|
|
│ └── log4j2.xml
|
|
|
|
|
└── start.d
|
|
|
|
|
├── logging-log4j2.ini
|
|
|
|
|
....
|
|
|
|
|
|
|
|
|
|
[[example-logging-logback]]
|
|
|
|
|
==== Logging with Logback
|
|
|
|
|
|
|
|
|
|
It is possible to have the Jetty Server logging configured so that Logback controls the output of logging events produced by Jetty.
|
|
|
|
|
This is accomplished by configuring Jetty for logging to `Logback`, which uses http://slf4j.org/manual.html[Slf4j] and the http://logback.qos.ch/[Logback Implementation for Slf4j].
|
|
|
|
|
|
|
|
|
|
To set up Jetty logging via Logback, enable the `logging-logback` module.
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-logback
|
|
|
|
|
|
|
|
|
|
ALERT: There are enabled module(s) with licenses.
|
|
|
|
|
The following 2 module(s):
|
|
|
|
|
+ contains software not provided by the Eclipse Foundation!
|
|
|
|
|
+ contains software not covered by the Eclipse Public License!
|
|
|
|
|
+ has not been audited for compliance with its license
|
|
|
|
|
|
|
|
|
|
Module: logback-impl
|
|
|
|
|
+ Logback: the reliable, generic, fast and flexible logging framework.
|
|
|
|
|
+ Copyright (C) 1999-2012, QOS.ch. All rights reserved.
|
|
|
|
|
+ This program and the accompanying materials are dual-licensed under
|
|
|
|
|
+ either:
|
|
|
|
|
+ the terms of the Eclipse Public License v1.0
|
|
|
|
|
+ as published by the Eclipse Foundation:
|
|
|
|
|
+ http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
+ or (per the licensee's choosing) under
|
|
|
|
|
+ the terms of the GNU Lesser General Public License version 2.1
|
|
|
|
|
+ as published by the Free Software Foundation:
|
|
|
|
|
+ http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
|
|
|
|
|
|
|
|
|
|
Module: slf4j-api
|
|
|
|
|
+ SLF4J is distributed under the MIT License.
|
|
|
|
|
+ Copyright (c) 2004-2013 QOS.ch
|
|
|
|
|
+ All rights reserved.
|
|
|
|
|
+ Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
|
+ a copy of this software and associated documentation files (the
|
|
|
|
|
+ "Software"), to deal in the Software without restriction, including
|
|
|
|
|
+ without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
+ distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
+ permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
+ the following conditions:
|
|
|
|
|
+ The above copyright notice and this permission notice shall be
|
|
|
|
|
+ included in all copies or substantial portions of the Software.
|
|
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
|
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
|
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
|
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
|
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
|
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
Proceed (y/N)? y
|
|
|
|
|
INFO : slf4j-api transitive, ini template available with --add-to-start=slf4j-api
|
|
|
|
|
INFO : logback-impl transitive, ini template available with --add-to-start=logback-impl
|
|
|
|
|
INFO : slf4j-logback transitive
|
|
|
|
|
INFO : logging-logback initialized in ${jetty.base}/start.d/logging-logback.ini
|
|
|
|
|
INFO : resources transitive
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-api-1.7.21.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/ch/qos/logback/logback-core/1.1.7/logback-core-1.1.7.jar to ${jetty.base}/lib/logback/logback-core-1.1.7.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/ch/qos/logback/logback-classic/1.1.7/logback-classic-1.1.7.jar to ${jetty.base}/lib/logback/logback-classic-1.1.7.jar
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
|
|
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── lib
|
|
|
|
|
│ ├── logback
|
|
|
|
|
│ │ ├── logback-classic-1.1.7.jar
|
|
|
|
|
│ │ └── logback-core-1.1.7.jar
|
|
|
|
|
│ └── slf4j
|
|
|
|
|
│ └── slf4j-api-1.7.21.jar
|
|
|
|
|
├── resources
|
|
|
|
|
│ └── logback.xml
|
|
|
|
|
└── start.d
|
|
|
|
|
├── logging-logback.ini
|
|
|
|
|
....
|
|
|
|
|
|
|
|
|
|
At this point Jetty is configured so that the Jetty server itself will log using Logback, using the Logback configuration found in `{$jetty.base}/resources/logback.xml`.
|
|
|
|
|
|
|
|
|
|
==== Logging with Java Util Logging
|
|
|
|
|
|
|
|
|
|
[[example-logging-java-util-logging]]
|
|
|
|
|
===== Java Util Logging with SLF4J
|
|
|
|
|
It is possible to have the Jetty Server logging configured so that `java.util.logging` controls the output of logging events produced by Jetty.
|
|
|
|
|
|
|
|
|
|
This example demonstrates how to configuring Jetty for logging to `java.util.logging` via http://slf4j.org/manual.html[Slf4j] and the http://slf4j.org/manual.html#swapping[Slf4j binding layer for java.util.logging].
|
|
|
|
|
If you want to use the built-in native `java.util.logging` implementation, see link:#example-logging-java-util-logging-native[Native Java Util Logging].
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-jul
|
|
|
|
|
|
|
|
|
|
ALERT: There are enabled module(s) with licenses.
|
|
|
|
|
The following 1 module(s):
|
|
|
|
|
+ contains software not provided by the Eclipse Foundation!
|
|
|
|
|
+ contains software not covered by the Eclipse Public License!
|
|
|
|
|
+ has not been audited for compliance with its license
|
|
|
|
|
|
|
|
|
|
Module: slf4j-api
|
|
|
|
|
+ SLF4J is distributed under the MIT License.
|
|
|
|
|
+ Copyright (c) 2004-2013 QOS.ch
|
|
|
|
|
+ All rights reserved.
|
|
|
|
|
+ Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
|
+ a copy of this software and associated documentation files (the
|
|
|
|
|
+ "Software"), to deal in the Software without restriction, including
|
|
|
|
|
+ without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
+ distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
+ permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
+ the following conditions:
|
|
|
|
|
+ The above copyright notice and this permission notice shall be
|
|
|
|
|
+ included in all copies or substantial portions of the Software.
|
|
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
|
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
|
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
|
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
|
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
|
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
Proceed (y/N)? y
|
|
|
|
|
INFO : slf4j-api transitive, ini template available with --add-to-start=slf4j-api
|
|
|
|
|
INFO : slf4j-jul transitive
|
|
|
|
|
INFO : logging-jul initialized in ${jetty.base}/start.d/logging-jul.ini
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-api-1.7.21.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-jdk14/1.7.21/slf4j-jdk14-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-jdk14-1.7.21.jar
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
|
|
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── lib
|
|
|
|
|
│ └── slf4j
|
|
|
|
|
│ ├── slf4j-api-1.7.21.jar
|
|
|
|
|
│ └── slf4j-jdk14-1.7.21.jar
|
|
|
|
|
└── start.d
|
|
|
|
|
├── logging-jul.ini
|
|
|
|
|
....
|
|
|
|
|
|
|
|
|
|
==== Logging with Java Commons Logging
|
|
|
|
|
Jetty provides support of the Java Commons Logging (jcl) through the `logging-jcl` module, using Slf4j as a bridge.
|
|
|
|
|
This can be enabled as shown below:
|
|
|
|
|
|
|
|
|
|
[source, screen, subs="{sub-order}"]
|
|
|
|
|
....
|
|
|
|
|
$ java -jar ../start.jar --add-to-start=logging-jcl
|
|
|
|
|
|
|
|
|
|
ALERT: There are enabled module(s) with licenses.
|
|
|
|
|
The following 2 module(s):
|
|
|
|
|
+ contains software not provided by the Eclipse Foundation!
|
|
|
|
|
+ contains software not covered by the Eclipse Public License!
|
|
|
|
|
+ has not been audited for compliance with its license
|
|
|
|
|
|
|
|
|
|
Module: jcl-impl
|
|
|
|
|
+ Log4j is released under the Apache 2.0 license.
|
|
|
|
|
+ http://www.apache.org/licenses/LICENSE-2.0.html
|
|
|
|
|
|
|
|
|
|
Module: slf4j-api
|
|
|
|
|
+ SLF4J is distributed under the MIT License.
|
|
|
|
|
+ Copyright (c) 2004-2013 QOS.ch
|
|
|
|
|
+ All rights reserved.
|
|
|
|
|
+ Permission is hereby granted, free of charge, to any person obtaining
|
|
|
|
|
+ a copy of this software and associated documentation files (the
|
|
|
|
|
+ "Software"), to deal in the Software without restriction, including
|
|
|
|
|
+ without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
|
+ distribute, sublicense, and/or sell copies of the Software, and to
|
|
|
|
|
+ permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
|
+ the following conditions:
|
|
|
|
|
+ The above copyright notice and this permission notice shall be
|
|
|
|
|
+ included in all copies or substantial portions of the Software.
|
|
|
|
|
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
|
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
|
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
|
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
|
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
|
|
|
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
|
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
|
Proceed (y/N)? y
|
|
|
|
|
INFO : slf4j-api transitive, ini template available with --add-to-start=slf4j-api
|
|
|
|
|
INFO : jcl-impl transitive, ini template available with --add-to-start=jcl-impl
|
|
|
|
|
INFO : slf4j-jcl transitive
|
|
|
|
|
INFO : logging-jcl initialized in ${jetty.base}/start.d/logging-jcl.ini
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-api/1.7.21/slf4j-api-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-api-1.7.21.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar to ${jetty.base}/lib/jcl/commons-logging-1.1.3.jar
|
|
|
|
|
DOWNLOAD: http://central.maven.org/maven2/org/slf4j/slf4j-jcl/1.7.21/slf4j-jcl-1.7.21.jar to ${jetty.base}/lib/slf4j/slf4j-jcl-1.7.21.jar
|
|
|
|
|
INFO : Base directory was modified
|
|
|
|
|
|
|
|
|
|
$ tree
|
|
|
|
|
.
|
|
|
|
|
├── lib
|
|
|
|
|
│ ├── jcl
|
|
|
|
|
│ │ └── commons-logging-1.1.3.jar
|
|
|
|
|
│ └── slf4j
|
|
|
|
|
│ ├── slf4j-api-1.7.21.jar
|
|
|
|
|
│ └── slf4j-jcl-1.7.21.jar
|
|
|
|
|
└── start.d
|
|
|
|
|
├── logging-jcl.ini
|
|
|
|
|
....
|