You can configure the logging levels, maximum log file size, and the maximum number of
log files that are used by the mqweb server which hosts the IBM® MQ Console and REST API. You can configure logging by using the
setmqweb command.
Before you begin
To complete this task, you must be a user with certain privileges so that you can
use the
dspmqweb and
setmqweb commands:
On z/OS®, you must have authority to
run the dspmqweb and setmqweb commands, and write access to the
mqwebuser.xml file.
On all other operating systems, you must be a
privileged user.
About this task
The log files for the mqweb server can be found in one of the following directories:
The messaging trace files for the mqweb server can be found in one of the following directories:
For more information about enabling trace for the IBM MQ Console and REST API, see Tracing the IBM MQ Console and REST API.
Procedure
-
View the current configuration of the REST API
logging by using the following command:
dspmqweb properties -a
The
maxTraceFileSize field
shows the maximum trace file size, the
maxTraceFiles field shows the maximum number
of trace files, and the
traceSpec field shows the level of trace used. In addition,
the
maxMsgTraceFileSize field shows the maximum messaging trace file size and the
maxMsgTraceFiles field shows the maximum number of messaging trace files. For more
information, see
dspmqweb.
-
Configure the maximum log file size:
- Set the maximum log file size by using the following command:
setmqweb properties
-k maxTraceFileSize -v size
where size
specifies the size, in MB, that each log file can reach for the IBM MQ Console.
- Reset the maximum log file size to the default value of 20 MB by using the following
command:
setmqweb properties -k maxTraceFileSize -d
-
Configure the maximum number of files to use for logging:
- Set the maximum number of files to use for logging by using the following
command:
setmqweb properties -k maxTraceFiles -v max
where max specifies the maximum number of files for the IBM MQ Console.
- Reset the maximum number of files to use for logging to the default value of 2 by using the
following command:
setmqweb properties -k maxTraceFiles -d
-
Configure the maximum messaging trace size:
- Set the maximum messaing trace size by using the following command:
setmqweb properties
-k maxMsgTraceFileSize -v size
where size
specifies the size, in MB, that each log file can reach.
- Reset the maximum log file size to the default value of 200 MB by using the following
command:
setmqweb properties -k maxMsgTraceFileSize -d
-
Configure the maximum number of messaging trace files to use:
- Set the maximum number of files to use for messaging trace by using the following
command:
setmqweb properties -k maxMsgTraceFiles -v max
where max specifies the maximum number of files.
- Reset the maximum number of files to use for messaging trace to the default value of 5 by using the
following command:
setmqweb properties -k maxMsgTraceFiles -d
-
Configure the level of logging that is used:
- Set the level of logging that is used by using the following command:
setmqweb
properties -k traceSpec -v level
where level is
one of the values listed in Table 1. The table outlines the logging
levels in increase level of detail. When you enable a logging level, you also enable each level
before it. For example, if you enable the *=warning logging level, you also
enable *=severe, and *=fatal logging levels.
Change
this value when IBM Service requests it.
- Reset the level of logging that is used to the default value of *=info
by using the following command:
setmqweb properties -k traceSpec -d
Table 1. Valid logging levels
| Value |
Logging level applied |
| *=off |
Logging is turned off. |
| *=fatal |
Task cannot continue and component, application, and server cannot function. |
| *=severe |
Task cannot continue but component, application, and server can still function. This level
can also indicate an impending unrecoverable error. |
| *=warning |
Potential error or impending error. This level can also indicate a progressive failure (for
example, the potential leaking of resources). |
| *=audit |
Significant event affecting server state or resources |
| *=info |
General information outlining overall task progress |
| *=config |
Configuration change or status |
| *=detail |
General information detailing subtask progress |
| *=fine |
Trace information - General trace + method entry, exit, and return values |
| *=finer |
Trace information - Detailed trace |
| *=finest |
Trace information - A more detailed trace that includes all the detail that is needed to
debug problems |
| *=all |
All events are logged |