Skip to content

Commit

Permalink
Merge pull request #3792 from masini/master
Browse files Browse the repository at this point in the history
Added  Access Log Configuration Sample Documentation
  • Loading branch information
gsmet committed Nov 25, 2019
2 parents 40981d8 + 641bd8f commit cd893b3
Showing 1 changed file with 28 additions and 1 deletion.
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.

0 comments on commit cd893b3

Please sign in to comment.