From dcfbdf3d33427e8d94b4ea7c9857acb6dcc40c6a Mon Sep 17 00:00:00 2001 From: WalkerWatch Date: Wed, 15 Mar 2017 15:21:39 -0400 Subject: [PATCH 1/2] Minor formatting updates. Signed-off-by: WalkerWatch --- .../default-logging-with-stderrlog.adoc | 34 ++++++++++--------- .../logging/example-java-util-logging.adoc | 4 +-- .../example-logback-centralized-logging.adoc | 6 ++-- .../logging/example-logback.adoc | 4 +-- .../example-slf4j-multiple-loggers.adoc | 4 +-- 5 files changed, 27 insertions(+), 25 deletions(-) diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/default-logging-with-stderrlog.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/default-logging-with-stderrlog.adoc index 13d7d6a5279..ff68b108aff 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/default-logging-with-stderrlog.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/default-logging-with-stderrlog.adoc @@ -20,7 +20,7 @@ [[stderrlog-configuration]] ==== StdErrLog Configuration -If you do nothing to configure a separate logging framework, Jetty will default to using an internal `org.eclipse.jetty.util.log.StdErrLog` implementation. +If you do nothing to configure a separate logging framework, Jetty will default to using an internal `org.eclipse.jetty.util.log.StdErrLog` implementation. This will output all logging events to STDERR (aka `System.err`). Simply use Jetty and `StdErrLog` based logging is output. @@ -45,6 +45,8 @@ The default configuration for logging output will create a file `${jetty.logs}/y For more advanced logging configurations, please consider use of a separate logging library. +[[stderr-properties]] +==== The jetty-logging.properties File The recommended way to configure `StdErrLog` is to create a `${jetty.home}/resources/jetty-logging.properties` file, specify the log implementation to `StdErrLog` and then setup logging levels. [source,properties] @@ -60,31 +62,31 @@ org.eclipse.jetty.websocket.LEVEL=DEBUG There are a number of properties that can be defined in the configuration that will affect the behavior of `StdErrLog`. `.LEVEL=`:: - Sets the logging level for all loggers within the `name` specified to the level, which can be (in increasing order of restriction) `ALL`, `DEBUG`, `INFO`, `WARN`, `OFF`. + Sets the logging level for all loggers within the `name` specified to the level, which can be (in increasing order of restriction) `ALL`, `DEBUG`, `INFO`, `WARN`, `OFF`. The name (or hierarchy) can be a specific fully qualified class or a package namespace. - For example, `org.eclipse.jetty.http.LEVEL=DEBUG` is a package namespace approach to turn all loggers in the Jetty HTTP package to DEBUG level, and `org.eclipse.jetty.io.ChanelEndPoint.LEVEL=ALL` turns on all logging events for the specific class, including `DEBUG`, `INFO`, `WARN` (and even special internally ignored exception classes). + For example, `org.eclipse.jetty.http.LEVEL=DEBUG` is a package namespace approach to turn all loggers in the Jetty HTTP package to DEBUG level, and `org.eclipse.jetty.io.ChanelEndPoint.LEVEL=ALL` turns on all logging events for the specific class, including `DEBUG`, `INFO`, `WARN` (and even special internally ignored exception classes). If more than one system property specifies a logging level, the most specific one applies. `.SOURCE=`:: - Named 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 (this configurable does not support package name hierarchy). - Default is false. + Named 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 (this configurable does not support package name hierarchy). + Default is false. Be aware that this is a slow operation and has an impact on performance. `.STACKS=`:: - Named Logger specific, controls the display of stacktraces. + Named Logger specific, controls the display of stacktraces. Name must be a fully qualified class name (this configurable does not support package name hierarchy). Default is true. `org.eclipse.jetty.util.log.stderr.SOURCE=`:: - Special Global Configuration. - Attempts to print the Java source file name and line number from where the logging event originated. + Special Global Configuration. + Attempts to print the Java source file name and line number from where the logging event originated. Default is false. `org.eclipse.jetty.util.log.stderr.LONG=`:: - Special Global Configuration. - When true, outputs logging events to `STDERR` using long form, fully qualified class names. + 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. - + ++ * Example when set to false: - + ++ [source, screen, subs="{sub-order}"] .... 2014-06-03 14:36:16.013:INFO:oejs.Server:main: jetty-9.2.0.v20140526 @@ -93,9 +95,9 @@ There are a number of properties that can be defined in the configuration that w 2014-06-03 14:36:17.880:INFO:oejs.ServerConnector:main: Started ServerConnector@34f2d11a{HTTP/1.1}{0.0.0.0:8080} 2014-06-03 14:36:17.888:INFO:oejs.Server:main: Started @257ms .... - + ++ * Example when set to true: - + ++ [source, screen, subs="{sub-order}"] .... 2014-06-03 14:38:19.019:INFO:org.eclipse.jetty.server.Server:main: jetty-9.2.0.v20140526 @@ -108,7 +110,7 @@ There are a number of properties that can be defined in the configuration that w [[deprecated-parameters]] ==== Deprecated Parameters -These parameters existed in prior versions of Jetty, and are no longer supported. +These parameters existed in prior versions of Jetty, and are no longer supported. They are included here for historical (and search engine) reasons. `org.eclipse.jetty.util.log.DEBUG`:: diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/example-java-util-logging.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/example-java-util-logging.adoc index ab23492ec0e..5f205af3e23 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/example-java-util-logging.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/example-java-util-logging.adoc @@ -52,7 +52,7 @@ INFO: resources enabled in ${jetty.base}/start.ini The replacement `logging.mod` performs a number of tasks. . `mybase` is a `${jetty.base}` directory -. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/ `and becomes the `${jetty.home}` directory for this demonstration. +. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/` and becomes the `${jetty.home}` directory for this demonstration. . The `curl` command downloads the replacement `logging.mod` and puts it into the `${jetty.base}/modules/` directory for use by `mybase` only. . The `start.jar --add-to-start=logging` command performs a number of steps to make the logging module available to the `${jetty.base}` configuration. .. The `--module=logging` command is added to the `${jetty.base}/start.ini` configuration. @@ -82,4 +82,4 @@ Other logging frameworks are more reliable in that they always initialize and co * While it is possible to configure `java.util.logging` sooner, even at JVM startup, the example demonstrated here does not show this technique. For more information consult the official `java.util.logging.LogManager` javadoc http://docs.oracle.com/javase/7/docs/api/java/util/logging/LogManager.html[documentation from Oracle]. -____ \ No newline at end of file +____ diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/example-logback-centralized-logging.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/example-logback-centralized-logging.adoc index 49f38ab23a7..069f345077f 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/example-logback-centralized-logging.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/example-logback-centralized-logging.adoc @@ -17,7 +17,7 @@ [[example-logging-logback-centralized]] === Example: Centralized Logging with Logback -The term _Centralized Logging_ refers to a forced logging configuration for the Jetty Server and all web applications that are deployed on the server. +The term _Centralized Logging_ refers to a forced logging configuration for the Jetty Server and all web applications that are deployed on the server. It routes all logging events from the web applications to a single configuration on the Server side. The example below shows how to accomplish this with Jetty and Slf4j, using `Logback` to manage the final writing of logs to disk. @@ -30,7 +30,7 @@ ____ This configuration is essentially the multiple logger configuration with added configuration to the deployers to force a `WebAppClassLoader` change to use the server classpath over the webapps classpath for the logger specific classes. -The technique used by this configuration is to provide an link:{JDURL}org/eclipse/jetty/deploy/AppLifeCycle.Binding.html[AppLifeCycle.Binding] against the link:{JDURL}/org/eclipse/jetty/deploy/AppLifeCycle.html[`"deploying"`node] that modifies the link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#addSystemClass(java.lang.String)[WebAppContext.addSystemClass(String)] for the common logging classes. +The technique used by this configuration is to provide an link:{JDURL}org/eclipse/jetty/deploy/AppLifeCycle.Binding.html[AppLifeCycle.Binding] against the link:{JDURL}/org/eclipse/jetty/deploy/AppLifeCycle.html[`"deploying"`node] that modifies the link:{JDURL}/org/eclipse/jetty/webapp/WebAppContext.html#addSystemClass(java.lang.String)[WebAppContext.addSystemClass(String)] for the common logging classes. See https://github.com/jetty-project/jetty-webapp-logging/blob/master/src/main/java/org/eclipse/jetty/webapp/logging/CentralizedWebAppLoggingBinding.java[org.eclipse.jetty.logging.CentralizedWebAppLoggingBinding] for actual implementation. A convenient replacement `logging` module has been created to bootstrap your `${jetty.base}` directory for capturing all Jetty server logging from multiple logging frameworks into a single logging output file managed by Logback. @@ -81,7 +81,7 @@ INFO: resources enabled in ${jetty.base}/start.ini The replacement `logging.mod` performs a number of tasks. . `mybase` is a `${jetty.base}` directory. -. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/ `and becomes the `${jetty.home}` directory for this demonstration. +. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/` and becomes the `${jetty.home}` directory for this demonstration. . The `curl` command downloads the replacement `logging.mod` and puts it into the `${jetty.base}/modules/` directory for use by mybase only. . The `start.jar --add-to-start=logging,webapp-logging` command performs a number of steps to make the logging module available to the `${jetty.base}` configuration. .. Several entries are added to the `${jetty.base}/start.ini` configuration. diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/example-logback.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/example-logback.adoc index 1c4b64e8b1b..a939037df9d 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/example-logback.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/example-logback.adoc @@ -17,7 +17,7 @@ [[example-logging-logback]] === Example: 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. +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]. A convenient replacement `logging` module has been created to bootstrap the `${jetty.base}` directory for logging with logback. @@ -48,7 +48,7 @@ DOWNLOAD: https://raw.githubusercontent.com/jetty-project/logging-modules/master The replacement `logging.mod` performs a number of tasks. . `mybase` is a `${jetty.base}` directory. -. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/ `and becomes the `${jetty.home}` directory for this demonstration. +. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/` and becomes the `${jetty.home}` directory for this demonstration. . The `curl` command downloads the replacement `logging.mod` and puts it into the `${jetty.base}/modules/` directory for use by `mybase` only. . The `start.jar --add-to-start=logging` command performs a number of steps to make the logging module available to the `${jetty.base}` configuration. .. The `--module=logging` command is added to the `${jetty.base}/start.ini` configuration. diff --git a/jetty-documentation/src/main/asciidoc/administration/logging/example-slf4j-multiple-loggers.adoc b/jetty-documentation/src/main/asciidoc/administration/logging/example-slf4j-multiple-loggers.adoc index d63930e4f25..32a7ece950a 100644 --- a/jetty-documentation/src/main/asciidoc/administration/logging/example-slf4j-multiple-loggers.adoc +++ b/jetty-documentation/src/main/asciidoc/administration/logging/example-slf4j-multiple-loggers.adoc @@ -70,7 +70,7 @@ Logging API:: Slf4j Binding JAR:: * Special JARs, created and maintained by the Slf4j project, that pretend to be the various Logging API implementation classes, but instead just route that Logging API's events to Slf4j to handle. * There MAY be multiple Slf4j binding JARs present on the classpath at the same time. - + * For a single logging API, if you choose to use the Slf4j binding JAR, then you MUST NOT include the SLf4j adapter JAR or underlying logging framework in the classpath as well. Slf4j Adapter Jar:: * These JARs are created and maintained by the Slf4j project and route Slf4j logging events to a specific underlying logging framework. @@ -118,7 +118,7 @@ INFO: resources enabled in ${jetty.base}/start.ini The replacement `logging.mod` performs a number of tasks. . `mybase` is a `${jetty.base}` directory. -. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/ `and becomes the `${jetty.home}` directory for this demonstration. +. The jetty-distribution is unpacked (and untouched) into `/opt/jetty-dist/` and becomes the `${jetty.home}` directory for this demonstration. . The `curl` command downloads the replacement `logging.mod` and puts it into the `${jetty.base}/modules/` directory for use by `mybase` only. . The `start.jar --add-to-start=logging` command performs a number of steps to make the logging module available to the `${jetty.base}` configuration. .. The `--module=logging` command is added to the `${jetty.base}/start.ini` configuration. From 136ae624ef3fb4bae1f2649873408b65662d397b Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Wed, 15 Mar 2017 18:11:18 +1100 Subject: [PATCH 2/2] Issue #1399 --- .../test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java index 27ad7fc965f..baec8f9c622 100644 --- a/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java +++ b/jetty-server/src/test/java/org/eclipse/jetty/server/ssl/SlowClientsTest.java @@ -44,8 +44,10 @@ import org.eclipse.jetty.util.log.Log; import org.eclipse.jetty.util.log.Logger; import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.util.thread.QueuedThreadPool; +import org.junit.Ignore; import org.junit.Test; +@Ignore public class SlowClientsTest { private Logger logger = Log.getLogger(getClass());