Configuring XMS .NET trace using an application configuration file
If you are using IBM® MQ classes for XMS .NET Framework, you can configure trace for XMS .NET applications with an application configuration file. The trace section of this file includes parameters that define what is to be traced, the trace file location and maximum allowed size, the number of trace files used, and the trace file format.
About this task
Using the application configuration file is not supported for IBM MQ classes for XMS .NET Standard. If you are using IBM MQ classes for XMS .NET Standard, you must configure trace from the XMS environment variables. For further details, see Configuring XMS .NET trace using XMS environment variables.
Procedure
- Debug trace
- Exception trace
- Warnings, informational messages, and error messages
- Method entry and exit trace
The following example shows the trace settings defined in the Trace section of an application configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<configSections>
<sectionGroup name="IBM.XMS">
<section name="Trace"
type="System.Configuration.SingleTagSectionHandler" />
</sectionGroup>
</configSections>
<IBM.XMS>
<Trace traceSpecification="*=all=enabled" traceFilePath=""
traceFileSize="20000000" traceFileNumber="3"
traceFormat="advanced" />
</IBM.XMS>
</configuration>
Parameter | Description |
---|---|
traceSpecification=ComponentName=type=state |
type can be any of the following trace types:
You can string multiple trace elements together by using a ':' (colon) delimiter. |
traceFilePath= |
If you do not specify a traceFilePath, or if the traceFilePath is present but contains an empty
string, the trace file is placed in the current directory. To store the trace file in a named
directory, specify the directory name in the traceFilePath, for example:
|
traceFileSize= |
The maximum allowed size of the trace file. When a file reaches this size, it
is archived and renamed. The default maximum is 20 MB, which is specified as
traceFileSize= . |
traceFileNumber= |
The number of trace files that are to be retained. The default is 4 (one active file and 3 archive files). The minimum number allowed is 2. |
traceFormat= |
The default trace format is basic. Trace files are produced in this format if you specify
If you require trace that is compatible with trace analyzer tools, you must specify
|
The trace settings in the application configuration file are dynamic, and are reread every time the file is saved or replaced. If errors are found in the file after it is edited, the trace file settings revert to their default values.