Undertow WildFly Subsystem Configuration - access-log: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 76: Line 76:
* <tt>%a</tt> remote IP address
* <tt>%a</tt> remote IP address
* <tt>%A</tt> local IP address
* <tt>%A</tt> local IP address
%b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent
* <tt>%b</tt> bytes sent, excluding HTTP headers, or '-' if no bytes were sent
%B - Bytes sent, excluding HTTP headers
* <tt>%B</tt> bytes sent, excluding HTTP headers
%h - Remote host name
* <tt>%h</tt> remote host name
%H - Request protocol
* <tt>%H</tt> request protocol
%l - Remote logical username from identd (always returns '-')
* <tt>%l</tt> remote logical username from identd (always returns '-')
%m - Request method
* <tt>%m</tt> request method
%p - Local port
* <tt>%p</tt> local port
%q - Query string (excluding the '?' character)
* <tt>%q</tt> query string (excluding the '?' character)
%r - First line of the request
* <tt>%r</tt> first line of the request
%s - HTTP status code of the response
* <tt>%s</tt> HTTP status code of the response
%t - Date and time, in Common Log Format format
* <tt>%t</tt> date and time, in Common Log Format format
%u - Remote user that was authenticated
* <tt>%u</tt> remote user that was authenticated
%U - Requested URL path
* <tt>%U</tt> requested URL path
%v - Local server name
* <tt>%v</tt> local server name
%D - Time taken to process the request, in millis
* <tt>%D</tt> time taken to process the request, in millis
%T - Time taken to process the request, in seconds
* <tt>%T</tt> time taken to process the request, in seconds
%I - current Request thread name (can compare later with stacktraces)
* <tt>%I</tt> current request thread name

Revision as of 19:02, 20 January 2016

Internal

Overview

This page documents the configuration of the Undertow AccessLogHandler. The handler generates log entries for each request. The handler can log any attributed that is provided with the ExchangeAttribute mechanism. The most common are presented below in the Log Patterns section.

<subsystem xmlns="urn:jboss:domain:undertow:3.0">

   ...

   <server name="default-server">
      ...
      <host name="default-host" alias="localhost">
         <location name="/" .../>
         <access-log/>
         ...
      </host>
   </server>

   <servlet-container .../>

   ...

 </subsystem>

Configurable Attributes

pattern

The default value is "common".

worker

The default value is "default".

directory

The default value is "${jboss.server.log.dir}"

relative-to

The default value is "access_log"

suffix

The default value is ".log"

rotate

The default value is "true"

use-server-log

The default value is "false"

extended

The default value is "false"

predicate

Log Patterns

Named Patterns

"common": %h %l %u %t "%r" %s %b

"combined": %h %l %u %t "%r" %s %b "%{i,Referer}" "%{i,User-Agent}"

Pattern Elements

  • %a remote IP address
  • %A local IP address
  • %b bytes sent, excluding HTTP headers, or '-' if no bytes were sent
  • %B bytes sent, excluding HTTP headers
  • %h remote host name
  • %H request protocol
  • %l remote logical username from identd (always returns '-')
  • %m request method
  • %p local port
  • %q query string (excluding the '?' character)
  • %r first line of the request
  • %s HTTP status code of the response
  • %t date and time, in Common Log Format format
  • %u remote user that was authenticated
  • %U requested URL path
  • %v local server name
  • %D time taken to process the request, in millis
  • %T time taken to process the request, in seconds
  • %I current request thread name