5.2.3 Output format and output items of access log of NIO HTTP Server
This subsection describes the output format and the output items of access log of the NIO HTTP Server.
The processing results of requests of the NIO HTTP server are output to the access log. The following tables describe the output format and output items for the HTTP communication and the WebSocket communication handled by the NIO HTTP server.
- Organization of this subsection
(1) Access log for HTTP communication
The following table describes the output contents.
Format argument |
Output contents |
Output example |
---|---|---|
%a |
IP address of the Web client |
10.20.30.40 |
%A |
IP address of the J2EE server |
10.20.30.100 |
%b |
Number of bytes sent excluding the HTTP header. A hyphen (-) is output when the number of bytes is 0. |
2048 |
%B |
Number of bytes sent excluding the HTTP header. 0 is output when the number of bytes is 0. |
1024 |
%h |
Host name or IP address of the Web client. The IP address is output when the host name cannot be obtained. |
10.20.30.40 |
%H |
Request protocol |
HTTP/1.1 |
%l |
Remote log name. A hyphen (-) is always output#1. |
-- |
%m |
Request method |
GET |
%p |
Port number that received the request from the Web client |
80 |
%q |
Query string. The query string begins with a question mark (?). If the query string does not exist, an empty string is output. |
?id=100&page=15 |
%r |
Request line |
GET /index.html HTTP/1.0 |
%s |
Final status code |
200 |
%S#2 |
The value of the cookie name JSESSIONID is output. If the value does not exist, a hyphen (-) is output. |
00455AFE4DA4E7B7789F247B8FE5D605 |
%t |
The time when the processing of the request from the Web client was started is displayed with second precision. [dd/MMM/YYYY:HH:mm:ss Z] |
[18/Jan/2005:13:06:10 +0900] |
%T |
Time required for processing the request from the Web client (unit: seconds) |
2 |
%d |
The time when the processing of the request from the Web client was started is displayed with millisecond precision. [dd/MMM/YYYY:HH:mm:ss.nnn Z] (nnn indicates milliseconds.) |
[18/Jan/2005:13:06:10.152 +0900] |
%D |
Time required for processing the request from the Web client (unit: milliseconds) |
38 |
%u |
Basic authentication user name or form authentication user name. If there is no authentication user name, a hyphen (-) is output. |
user |
%U |
Request file path |
/index.html |
%v |
Local host name of the J2EE server |
server |
%{foo}i#3 |
Contents of the request header foo. If the foo header does not exist, a hyphen (-) is output. |
In the case of %{Host}i: www.example.com:8888 |
%{foo}c |
Of the cookie information sent by the Web client, the contents of the cookie whose name is foo. If there is no cookie whose name is foo, a hyphen (-) is output. |
In the case of %{MYSESSIONID}c: 00455AFE4DA4E7B7789F247B8FE5D605 |
%{foo}o#3 |
Contents of the response header foo. If the foo header does not exist, a hyphen (-) is output. |
In the case of %{Server}o: CosminexusComponentContainer |
%rootap |
Root application information |
10.100.10.100/1234/0x0000000000000001 |
%clport |
Port number that sent the request from the Web client |
888 |
- Notes
-
-
If you specify a character string that begins with % (such as %G) other than those listed in the preceding table, the message KDJE39401-W is output and the default format is used. Also, if you specify 0 characters (for example, %{}i) in the header content or cookie name specified in %{foo}i, %{foo}c, or %{foo}o, the message KDJE39401-W is output and the default format is used.
-
The maximum string length that can be used for the format type is 1,024 characters. If the string exceeds 1,024 characters, the message KDJE39400-W is output and the default value is used.
-
The characters that can be used for the format type are those from ASCII code 32 (decimal number) to less than 127 (decimal number).
-
If no string is specified, the message KDJE39009-W is output and the default value is used.
-
If a character outside the range is specified, the message KDJE39401-W is output and the default value is used.
-
- #1
-
The remote log name is the user name on the Web client side that is obtained by the Identification Protocol stipulated by RFC 1413.
- #2
-
The value displayed by %S is the value of the cookie name JSESSIONID, which is used as the standard HTTP session ID. If the name of the cookie name JSESSIONID has been changed in Servlet 3.0 or later, use %{foo}c.
- #3
-
The same header name might be sent multiple times in one HTTP request or HTTP response. In this case, the contents of all headers are output separated by commas (,).
The following shows the notation described with the format arguments.
%h %{X-Forwarded-For}i %l %u %d %rootap "%r" %s %b %D %S
The following shows the output format.
host-name-or-IP-address-of-the-Web-clientΔX-Forwarded-For-headerΔremote-log-nameΔauthentication-user-nameΔtime-when-the-processing-of-the-request-from-the-Web-client-was-startedΔroot-application-informationΔ"request-line"Δfinal-status-codeΔnumber-of-bytes-sent-excluding-the-HTTP-headerΔtime-required-for-processing-the-request-from-the-Web-clientΔHTTP-session-ID
- Note
-
A new line is inserted after the HTTP session ID.
- Legend
-
Δ: Single byte space
The following shows an example of output.
10.20.30.40 50.60.70.80 - user [18/Jan/2005:13:06:10.152 +0900] 10.100.10.100/1234/0x0000000000000001 "GET /index.html HTTP/1.0" 200 1024 38 00455AFE4DA4E7B7789F247B8FE5D605
(2) Access log for WebSocket communication
The following table describes the output contents.
Format argument |
Output contents |
Output example |
---|---|---|
%TS |
Time of sending or receiving the WebSocket frame |
2001/01/01 01:01:01.111 +0900 |
%IO |
Direction of sending or receiving the WebSocket frame. IN or OUT is output.
|
IN |
%OPCODE |
Type of the WebSocket frame. Text, Binary, Ping, Pong, or Close is output. |
Text |
%URI |
Request URL |
/websocket_server/test001 |
%FIN |
Identifier that indicates the end of the WebSocket frame. CONT or FINAL is output.
|
CONT |
%PAYLOADDATALEN |
Payload data length |
100 |
%ROOTAP |
Root application information |
10.100.10.100/1234/0x0000000000000001 |
%CLIENTAP |
Client application information |
10.100.10.100/1234/0x0000000000000001 |
%CLOSEREASON |
Reason why the WebSocket connection was disconnected |
NORMAL_CLOSURE:closereason specified by WebSocketClient001 |
%CLIENTADDR |
IP address and port number of the Web client |
10.20.30.40:55555 |
%SERVERADDR |
IP address and port number of the J2EE server |
10.20.30.100:44444 |
%SESSIONID |
WebSocket session ID |
11111111-2222-3333-4444-555555555555 |
%MASK |
Indicates the mask set for the WebSocket frame information.
|
MASK |
%MASKKEY |
Key used to mask the information in the WebSocket frame. If the information is not masked, a hyphen (-) is output. |
EEEEEEEE |
%ISEXTENDED |
Indicates the frame for which the endpoint is set to send or receive messages.
|
BASE |
%RSV |
Indicates reserved bits set by the client endpoint during the negotiation of an extension. |
RSV-000 |
%FRAMEMAINTYPE |
Specify whether the WebSocket frame is a data frame or control frame.
|
Data |
%PAYLOADDATA |
Payload data |
aaaaaa |
%PAYLOADDATA(n) |
Payload data when displaying only a certain number of characters indicating the beginning and end of the message. For binary, this is always a hyphen (-). |
aaaaaaaaaa....aaaaaaaaaa |
- Notes
-
-
The maximum string length that can be used for the format type is 1,024 characters. If the string exceeds 1,024 characters, the message KDJE39400-W is output and the default value is used.
-
If no string is specified, the message KDJE39009-W is output and the default value is used.
-
You can specify only the format arguments defined in the table connected by single byte spaces. When doing so, note the following points:
- The number of single byte spaces is not preserved.
- Leading and trailing spaces are not preserved.
- There are no restrictions on the order of the format arguments.
- There is a restriction on the number of occurrences (the use of the same format argument multiple times). If the same format argument is defined multiple times, only the first definition will be valid, and the second and subsequent definitions will not be valid.
-
The following shows the notation described with the format arguments.
%TS %IO %OPCODE %ROOTAP %URI %FIN %PAYLOADDATALEN %CLIENTAP %CLOSEREASON
The following shows the output format.
time-of-sending-or-receiving-the-WebSocket-frameΔdirection-of-sending-or-receiving-the-WebSocket-frameΔtype-of-the-WebSocket-frameΔroot-application-informationΔrequest-URLΔidentifier-that-indicates-the-end-of-the-WebSocket-frameΔpayload-data-lengthΔclient-application-informationΔreason-why-the-WebSocket-connection-was-disconnected
- Note
-
A new line is inserted after the payload data length.
- Legend
-
Δ: Single byte space
The following shows an example of output.
2001/01/01 01:01:01.111 +0900 IN Text10.100.10.100/1234/0x0000000000000001 /websocket_server/test001 CONT 100 10.100.10.100/1234/0x0000000000000003 -