FORMAT
The FORMAT
element specifies the line output of a log
message.
Syntax
<FORMAT [
Type="TEXT" ]
> field-id[
...]
</FORMAT>
- Type is an optional attribute whose value can only be
"
TEXT
". When set, log messages are formatted in a single line of text, without line breaks. New line characters are escaped. - The field-id specifies a field identifier. You can include multiple field identifiers by listing multiple field identifiers, separated by spaces. The order of the field identifiers determines the order of the fields in each line of the log output. Table 1 lists the valid field identifier names.
Field Identifier Name | Description |
---|---|
date |
Date of the event. |
time |
Time of the event. |
relative-time |
Time elapsed since the dispatcher started. |
process-id |
Process identifier. |
thread-id |
Thread identifier. |
location |
The filename and line number where the event occurred. Replaces
line and file Type attributes from earlier versions. |
contexts |
Internal data representing the successive context the process went through to reach the logged event. These data is formatted as type=value pairs separated by semicolons. |
event-type |
Event name. |
event-params |
Event details. XML fragment representing the structured information attached to the event. This XML fragment will be on a single line. If used this field should be the last one as it can contain data with spaces. |
When parsing the content of log files:
- A log message ends with a LF/CR character.
event-type
values are enclosed in double quotes (").event-params
values may contain any characters. This field should be put at the end of the log format string.- All other field values do not contain spaces.
- A missing value is replaced by a hyphen (-).
- Within
event-params
values, well-known, non-printable characters are replaced by standard C escape sequences; other non-printable characters use a hexadecimal encoding. - Single
event-params
values, such as raw text, have the following structure:Data Size=size Content=value
, wheresize
is the size of the value. event-params
contains the escaped log message.
Child elements
There are no child elements.
Usage
You use this element to specify the format and content of the line output of a log message.
Important:
If the CATEGORIES_FILTER
is set to ALL
, FORMAT
is ignored.
Examples
<FORMAT Type="TEXT">time event-type event-params</FORMAT>
<FORMAT>date time relative-time process-id thread-id contexts event-type event-params</FORMAT>
Parent elements
This element is a child of the LOG
element.