uCosminexus Application Server, Web Container Functionality Guide
The in-process HTTP server outputs the access log, performance analysis trace, thread trace, and communication trace for supporting application development, for performance analysis during operations, and for troubleshooting during failure. You can change the number and size of these files. You can also customize the log output format in the access log.
This subsection describes the customization of the access log output format in the in-process HTTP server. For details on changing the number and size of the access log and trace files in the in-process HTTP server, see 3.3.11 Settings for acquiring logs of the in-process HTTP server in the uCosminexus Application Server Maintenance and Migration Guide.
To customize the access log output format:
... <param> <param-name>webserver.logger.access_log.format_list</param-name> <param-value>formatA</param-value> </param> ... |
... <param> <param-name>webserver.logger.access_log.formatA</param-name> <param-value>%h %u %t "%r" %>s HostHeader="%{host}i"</param-value> </param> ... |
... <param> <param-name>webserver.logger.access_log.inprocess_http.usage_format</param-name> <param-value>formatA</param-value> </param> ... |
Application Server provides two types of formats namely common (default format) and combined (extended format) as the access log formats of the in-process HTTP server. When creating a new format, reference these formats.
The output format of access log is described below. Note that indicates one-byte space. Also, for the convenience of expression, the log is output across multiple lines, but the log is actually output in one line.
The output format of a default format is as follows:
Host-name-or-IP-address-of-Web-client Remote-log-name Authentication-user-name Start-time-of- Web-client-request-processing Request-line Final-status-code Number-of-bytes-sent-excluding-the-HTTP-header |
The output format of an extended format is described below:
Host-name-or-IP-address-of-Web-client Remote-log-name Authentication-user-name Start-time-of- Web-client-request-processing Request-line Final-status-code Number-of-bytes-sent-excluding-the-HTTP-header "Referer-header-contents" "User-Agent-header-contents" |
The underlined part is the difference between the default format and extended format. In the extended format, Referer header contents and User-Agent header contents is output in addition to the output contents of the default format.
An example of access log output in the default format is as follows:
10.20.30.40 - user [20/Dec/2004: 15: 45: 01 +0900] "GET /index.html HTTP/1.1" 200 8358 10.20.30.40 - user [20/Dec/2004: 15: 45: 01 +0900] "GET /left.html HTTP/1.1" 200 2358 10.20.30.40 - user [20/Dec/2004: 15: 45: 01 +0900] "GET /right.html HTTP/1.1" 200 4358 |
An example of access log output in the extended format is as follows:
10.20.30.40 - - [18/Jan/2005: 13: 06: 10 +0900] "GET / HTTP/1.0" 200 38 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) " 10.20.30.40 - - [18/Jan/2005: 13: 06: 25 +0900] "GET /demo/ HTTP/1.0" 500 684 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) " |
The following table lists the arguments of the access log format that are specified when you define the output format of the format:
Table 5-27 List of arguments of the access log format
Format arguments | Output contents | Example of output |
---|---|---|
%% | % Sign | % |
%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 ('-' in the case of 0 bytes) |
2048 |
%B | Number of bytes sent excluding the HTTP header ('0' in the case of 0 bytes) |
1024 |
%h | Host name or IP address of the Web client (IP address when the host name cannot be acquired) |
10.20.30.40 |
%H | Request protocol | HTTP/1.1 |
%l | Remote log name#1 (Always '-') |
- |
%m | Request method | GET |
%p | Port number that receives the request from the Web client | 80 |
%q | Query string (Begins with '? '. If the query string does not exist, null character) |
?id=100&page=15 |
%r | Request line | GET /index.html HTTP/1.1 |
%>s | Final status code (Internally redirected value is not output) |
200 |
%S#2 | User's session ID ('-' if the session ID does not exist) |
00455AFE4DA4E7B7789F247B8FE5D605 |
%t | Start time of the Web client request processing (Unit: seconds, output format: dd/MMM/YYYY:HH:mm:ss Z) |
[18/Jan/2005: 13: 06: 10 +0900] |
%T | Time required for processing the Web client request (Unit: seconds) |
2 |
%d | Start time of the Web client request processing (Unit: milliseconds, output format: 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 Web client request (Unit: milliseconds) |
2000 |
%u | Basic authentication user name, Form authentication user name ('-' when the authentication user name does not exist) |
user |
%U | Request file path | /index.html |
%v | Local host name of the J2EE server | server |
%{foo}I#3 | Contents of request header foo ('-' when foo header does not exist) |
In the case of %{Host}i, www.example.com:8888 |
%{foo}c | Of the Cookie information sent by the Web client, contents of Cookie name foo ('-' when the Cookie name does not include foo) |
In the case of %{JSESSIONID}c, 00455AFE4DA4E7B7789F247B8FE5D605 |
%{foo}o#3 | Contents of response header foo ('-' when the foo header does not exist) |
In the case of %{Server}o, CosminexusComponentContainer |
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.