Package org.apache.juli
Class JsonFormatter
java.lang.Object
java.util.logging.Formatter
org.apache.juli.OneLineFormatter
org.apache.juli.JsonFormatter
Provides the same information as the one line format but using JSON formatting.
All the information of the LogRecord is included as a one line JSON document,
including the full stack trace of the associated exception if any.
The LogRecord is mapped as attributes:
- time: the log record timestamp, with the default format as
yyyy-MM-dd'T'HH:mm:ss.SSSX
- level: the log level
- thread: the current on which the log occurred
- class: the class from which the log originated
- method: the method from which the log originated
- message: the log message
- throwable: the full stack trace from an exception, if present, represented as an array of string (the message first, then one string per stack trace element prefixed by a whitespace, then moving on to the cause exception if any)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Provides escaping of values so they can be included in a JSON document. -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.juli.OneLineFormatter
addTimestamp, getThreadName, getTimeFormat, setTimeFormat
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
-
Constructor Details
-
JsonFormatter
public JsonFormatter()
-
-
Method Details
-
format
- Overrides:
format
in classOneLineFormatter
-