FORMAT (under LOG for JGAS)
FORMAT
is the JGAS configuration element that specifies the format and
details included in a log message.
Syntax
<FORMAT Type="{
TEXT |
MULTILINE }
">field-id-list [...]
</FORMAT>
- The
Type
attribute can have one of two values:-
TEXT
, a log message is formatted without line breaks in a single line (new line characters are escaped).The default format for log file is
TEXT
, as set by thelog.file.format
resource. -
MULTILINE
format type handles formatting for multi-line output. It stops the logger from escaping new line characters, and provides for indentation, for example, when the DVM AUI tree is logged.The default for
CONSOLE
isMULTILINE
as specified by thelog.console.format
resource.
-
- field-id-list, specifies one or more field identifiers that define the detail
in the logged output. The fields are separated by spaces. The order of the fields determines the
order of the log output. Valid field identifier types are shown in Table 1.
Table 1. Log message field identifiers Type Description date
Date of logging the event. time
Time of logging the event. relative-time
Time elapsed since the dispatcher started. thread-id
Identifier of the thread logging the message. location
Location of the logged message in the source code; the file name and line number where the event occurred. contexts
Internal data representing the successive context the process went through to reach the logged event, for example, which VM, which HTTP request, etc. This data is formatted as type=value
pairs separated by semicolons.event-type
Type of event logged. event-params
Event details or message to be logged. XML fragment representing the structured information attached to the event. This XML fragment will be on a single line, when the attribute Type
is set to TEXT.Tip:If used, this field should be placed at the end as it can contain data with spaces.
Usage
You use this element to specify the format and details included in a log message.
Example
<FORMAT Type="TEXT">time event-type event-params</FORMAT>
<FORMAT Type="MULTILINE">date relative-time thread-id contexts
event-type event-params</FORMAT>
Reading the logged output
When reading the content of logged output:
- A log message ends with a line feed (LF) and carriage return (CR) character.
event-type
values are enclosed in double quotes (").event-params
values may contain characters and spaces. Well-known non-printable characters are replaced by standard C escape sequences; other non-printable characters use a hexadecimal encoding.- All other field values do not contain spaces.
- A missing value is replaced by a hyphen (-).
- Single event-params values, such as raw text, have the following structure:
Data Size=size Content=value
, wheresize
is the size of the value. - The
event-params
field output may contain:- a single line or escaped log message when the attribute
Type
is set toTEXT
. - a multi-line log message when the attribute
Type
is set toMULTILINE
.
- a single line or escaped log message when the attribute
Parent elements
This element is a child of the following elements: