Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Access Log Configuration sample documentation for RESTEasy + Servlet #3792

Merged
merged 2 commits into from
Nov 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 28 additions & 1 deletion docs/src/main/asciidoc/http-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,40 @@ To use Servlet you need to explicitly include `quarkus-undertow`:
</dependency>
----


=== undertow-handlers.conf

You can make use of the Undertow predicate language using an `undertow-handlers.conf` file. This file should be placed
in the `META-INF` directory of your application jar. This file contains handlers defined using the
link:http://undertow.io/undertow-docs/undertow-docs-2.0.0/index.html#predicates-attributes-and-handlers[Undertow predicate language].

=== Configuring HTTP Access Logs

You can add HTTP request logging by configuring the `AccessHandler` in the `undertow-handlers.conf` file.

The simplest possible configuration can be a standard Apache `common` Log Format:

[source]
----
access-log('common')
----

This will log every request using the standard Quarkus logging infrastructure under the `io.undertow.accesslog` category.

You can customize the category like this:

[source]
----
access-log(format='common', category='my.own.category')
----

Finally the logging format can be customized:

[source]
----
access-log(format='%h %l %u %t "%r" %s %b %D "%{i,Referer}" "%{i,User-Agent}" "%{i,X-Request-ID}"', category='my.own.category')
----

=== web.xml

If you are using a `web.xml` file as your configuration file, you can place it in the `src/main/resources/META-INF` directory.