Websphere MQ Everyplace

com.ibm.mqe.trace
Class MQeTraceToBinaryFile

java.lang.Object
  |
  +--com.ibm.mqe.trace.MQeTraceToBinary
        |
        +--com.ibm.mqe.trace.MQeTraceToBinaryFile
All Implemented Interfaces:
MQeTraceHandler

public class MQeTraceToBinaryFile
extends MQeTraceToBinary
implements MQeTraceHandler

A trace handler which collects binary trace information, and puts it into one or more trace files.

Each trace file is created in the same directory.

The name of each trace file is derived from

There are two modes for which trace can be collected into files; into a single file or into multiple files. In the single file mode the file will be permitted to grow until trace is stopped, or until there is no disk space available. In the multiple file mode trace is collected into several separate files, in sequence. The size of each file is controlled. If a file reaches the maximum size, then that file is closed, and the next in the sequence is created.

When this switch-over from one trace file to another occurs, the index of the trace file is incrimented.

For example, if file A000.trc is being written to, but to write to again would cause the file to exceed the maximum byte count, then A000.trc would be closed, and A001.trc would be created, opened, and written to.

If the file index reaches an upper limit then the file index will drop to the 0, effectively wrapping the file index. In this manner the oldest trace information is deleted, and the disk space it occupies is reclaimed for the storage of more recent trace information.

Each trace file stands as a trace file in its' own right.

The trace handler can be used in an 8.3 file system if appropriate options are set. For example, when fileNamePrefix is "A". The fileNameSuffix is ".trc".


Field Summary
static java.lang.String DEFAULT_FILE_NAME_PREFIX
          The default file name prefix used by the activate method, in the absence of one specified.
static java.lang.String DEFAULT_FILE_NAME_SUFFIX
          The default file name suffix used as part of a trace file name, in the absence of one specified.
static long MIN_TRACE_FILE_SIZE
          The minimum allowable size of a trace file.
 
Fields inherited from class com.ibm.mqe.trace.MQeTraceToBinary
UNICODE_CHARS_IN_MAX_LENGTH_STRING
 
Constructor Summary
MQeTraceToBinaryFile()
          For all parameters, default values are used.
MQeTraceToBinaryFile(java.lang.String directoryName, java.lang.String fileNamePrefix, java.lang.String fileNameSuffix, int filesExistingAtOnce, long maxFileSizeBeforeWrap)
          Constructs a trace handler, allowing caller to set properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.mqe.MQeTraceHandler
setFilter, traceMessage, traceMessage, traceMessage, traceMessage, traceMessage
 

Field Detail

DEFAULT_FILE_NAME_PREFIX

public static final java.lang.String DEFAULT_FILE_NAME_PREFIX
The default file name prefix used by the activate method, in the absence of one specified.

See Also:
Constant Field Values

DEFAULT_FILE_NAME_SUFFIX

public static final java.lang.String DEFAULT_FILE_NAME_SUFFIX
The default file name suffix used as part of a trace file name, in the absence of one specified.

See Also:
Constant Field Values

MIN_TRACE_FILE_SIZE

public static final long MIN_TRACE_FILE_SIZE
The minimum allowable size of a trace file.

See Also:
Constant Field Values
Constructor Detail

MQeTraceToBinaryFile

public MQeTraceToBinaryFile()
For all parameters, default values are used.

A single trace file will be generated in the current directory. The size of the trace file is unrestricted. It will grow until trace collection is stopped, or there is no disk space left.

The file name will be called "mqe0.trc"


MQeTraceToBinaryFile

public MQeTraceToBinaryFile(java.lang.String directoryName,
                            java.lang.String fileNamePrefix,
                            java.lang.String fileNameSuffix,
                            int filesExistingAtOnce,
                            long maxFileSizeBeforeWrap)
Constructs a trace handler, allowing caller to set properties.

Parameters:
directoryName - The name of the directory in which trace files will be created. For example, "." indicates that trace files should be created in the current directory. If null is specified, "." is assumed.
fileNamePrefix - Text used to form the first part of the trace file name. If a null value is passed, it is assumed to be "mqe".
fileNameSuffix - Text used to form the last part of the trace file name. If a null value is passed, a value of ".trc" will be used.
filesExistingAtOnce - The number of files which can be in the system at once. If 1 is specified, then only one trace file will be created, and it will grow indefinately with no size constraints until trace capture is disabled. ie: The maxFileSize parameter below is ignored in this case. If a value less than 1 is used, a value of 1 is asumed. If a value greater than 1 is used, then a series of trace files will be created.
maxFileSizeBeforeWrap - The largest size the trace file will be allowed to grow to, in bytes. This parameter may be ignored depending on the value of the filesExistingAtOnce parameter. If a value less than MIN_TRACE_FILE_SIZE is specified, then a value of MIN_TRACE_FILE_SIZE will be assumed.

Websphere MQ Everyplace