In the context of trace management, this function is used to add a contextual data to the current execution thread.
Context
Java client,
Java server,
Adelia Web client,
Adelia Cloud client.
Parameters
ALPHA(n) |
KeyName |
Name of key to which the contextual value is associated. The %X{KeyName} pattern is used to display the trace value. |
ALPHA(n) |
CtxtValue |
Contextual value to associate to the KeyName key. |
For example
CALL_DLL 'VaToolBx' 'VaToolBxPutMDCLogging' 'department' 'Accounting'
ADD_TRACE 'MyMessage'
If the traces are configured with a PatternLayout including the %X{department} pattern, the latter will be replaced by the 'Accouting' value.
Log4j.properties
log4j.appender.xxx.layout=org.apache.log4j.EnhancedPatternLayout
log4j.appender.xxx.layout.ConversionPattern=[%X{department}] %d %-5p %c [%X{program}] : %m%n
List of the VaToolBx functions by topic