In the context of trace management, this function is used to add a contextual data to the current execution thread.
Context
Windows client,
- Windows server,
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 'Accounting' value.
<Console name="CONSOLE" target="SYSTEM_OUT"> <PatternLayout pattern="[%X{department}] %d %-5p %c [%X{program}] : %m%n" /> </Console>
List of the VaToolBx functions by topic