Try OpenEdge Now
skip to main content
New Information
Progress Application Server for OpenEdge : Troubleshoot problems : Enhanced Mapped Diagnostic Content Logging in PAS for OpenEdge : Configure ABL Spring and Session Manager Logs for MDC
 
Configure ABL Spring and Session Manager Logs for MDC
The Logback logging framework supports using MDC tokens in the logging configuration layout pattern found in web-app-name/WEB-INF/logging.xml.
To enable the MDC values for ABL Spring and Session Manager, follow these instructions:
1. Locate the webapps\web-app-name\WEB-INF\logging.xml file for your target PAS for OpenEdge application.
2. Locate the logging pattern property which looks like the following codeblock:
<pattern>%d{HH:mm:ss.SSS}/%r [%thread] %-5level %logger{36} - %msg%n</pattern>
3. Edit the property to include desired MDC values, as seen in the following example:
<pattern>%d{HH:mm:ss.SSS}/%r [%thread] %-5level %X{OEReq.requestId} %logger{36} - %msg%n</pattern>
For more information on supported MDC field names, see the table below.
4. Restart your web application.
5. Edit the logging.xml file for any other target web applications.

Supported HTTP Request MDC Field Names

The following table shows all the MDC field names you can insert into the Spring and Session Manager logs:
Logging Field Name
Logging Field Description
Tomcat Access Log Syntax
ABL Application Log Syntax
OEReq.userId
The Spring Security authenticated user-id who is identified as the client from the server.
%{OEReq.userId}r
%X{OEReq.userId}
OEReq.sessionId
The HTTP Session ID assigned to the current PAS for OE client login session (if server login sessions are configured)
%S
%X{OEReq.SessionId}
OEReq.requestId
The PAS for OE assigned request ID relative to the server instance (Note: This property is not unique across load balanced server instances.)
%{OEReq.requestId}r
%X{OEReq.requestId}
OEReq.webapp
The Java web application context name the PAS for OE client request executes in
n/a
%X{OEReq.webapp}
OEReq.transport
The {apsv | soap | rest | web | file} PAS for OE service interface transport name the client's request executes in
n/a
%X{OEReq.transport}
OEReq.remoteHost
This field contains the remoteHost DNS address obtained from the PAS for OE network connection
%h
%X{OEReq.remoteHost}
OEReq.remoteAddr
This field contains the remoteHost IP address obtained from the PAS for OE network connection
%a
%X{OEReq.remoteAddr}
OEReq.serverName
This field contains the name of the PAS for OpenEdge server
%v
%X{OEReq.serverName}
OEReq.URI
This field contains the HTTP request's relative URI within OEReq.webapp
n/a
%X{OEReq.URI}
OEReq.protocol
This field contains the HTTP request scheme (http / https)
%H
%X{OEReq.protocol}
OEReq.method
This field contains the HTTP request's method name
%m
%X{OEReq.method}
OEReqHead.xxxxxx
This field contains the value of the HTTP request Header named xxxxxx or n/a if the header does not exist.
%{xxxxxx}i
%X{OEReqHead.xxxxxx}
Formatting Options for MDC values in ABL Spring and Session Manager logs
MDC values can be written to print a certain value if the requested information is not available. This is useful for troubleshooting. If an error occurs before the request ID, or other MDC field, is created, then the log can print a specified value.
The formatting options are written in this format:
%X{<name>[:-<default>]}
For example:
%X{OEReq.requestId}
The log shows the assigned request ID or blank if the logging occurs before a request ID can be created.
%X{OEReq.requestId:--}
The log shows the assigned request ID or "-" if the logging occurs before a request ID can be created.
%X{OEReq.requestId:-na}
The log shows the assigned request ID or "na" if the logging occurs before a request ID can be created
For more information, see the Logback layout and pattern documentation.