You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by njbartlett <gi...@git.apache.org> on 2017/11/10 19:35:05 UTC
[GitHub] felix pull request #127: Add request logging support to Felix Jetty
GitHub user njbartlett opened a pull request:
https://github.com/apache/felix/pull/127
Add request logging support to Felix Jetty
The Jetty embedding provided no way to enable web server request logging. This
commit enables request logging in the following ways:
1. Bundles can register a service of type RequestLog (from package
org.eclipse.jetty.server, already exported by the org.apache.felix.http.jetty
bundle). The Felix Jetty bundle will dispatch request messages to all
registered RequestLog services, or it can be configured with a filter to
dispatch only to a subset of service.
2. The Felix Jetty bundle provides an implementation of RequestLog that forwards
messages to the OSGi Log Service. This is disabled by default and must be
enabled with the system/config property
"org.apache.felix.http.requestlog.osgi.enable".
3. The Felix Jetty bundle additionally allows an instance of Jetty's built-in
NCSARequestLog to be created to write to an external file. This logger is
enabled by providing the "org.apache.felix.http.requestlog.file.path"
property. Various other properties can be provided that control e.g.
append/overwrite, sync/async, ignored request paths, etc.
N.B.: this code uses Java 8. This should not be a problem since the version of
Jetty used also depends on Java 8, however it was necessary to disable
animal-sniffer in the module as it does not support Java 8 as configured. This
is already done in the gogo/jline and gogo/runtime modules.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/njbartlett/felix jetty/requestlog
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/felix/pull/127.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #127
----
commit 73bcf5d494da92cfbac3368051f98d90b805b189
Author: Neil Bartlett <ne...@paremus.com>
Date: 2017-11-10T19:11:19Z
Add request logging support to Felix Jetty
The Jetty embedding provided no way to enable web server request logging. This
commit enables request logging in the following ways:
1. Bundles can register a service of type RequestLog (from package
org.eclipse.jetty.server, already exported by the org.apache.felix.http.jetty
bundle). The Felix Jetty bundle will dispatch request messages to all
registered RequestLog services, or it can be configured with a filter to
dispatch only to a subset of service.
2. The Felix Jetty bundle provides an implementation of RequestLog that forwards
messages to the OSGi Log Service. This is disabled by default and must be
enabled with the system/config property
"org.apache.felix.http.requestlog.osgi.enable".
3. The Felix Jetty bundle additionally allows an instance of Jetty's built-in
NCSARequestLog to be created to write to an external file. This logger is
enabled by providing the "org.apache.felix.http.requestlog.file.path"
property. Various other properties can be provided that control e.g.
append/overwrite, sync/async, ignored request paths, etc.
N.B.: this code uses Java 8. This should not be a problem since the version of
Jetty used also depends on Java 8, however it was necessary to disable
animal-sniffer in the module as it does not support Java 8 as configured. This
is already done in the gogo/jline and gogo/runtime modules.
----
---
[GitHub] felix pull request #127: Add request logging support to Felix Jetty
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/felix/pull/127
---