log
Prints a log event for each message. Messages always remain unchanged. The log message can be set using function interpolations described in Bloblang queries which allows you to log the contents and metadata of messages.
The level
field determines the log level of the printed events and can be any of the following values: TRACE, DEBUG, INFO, WARN, ERROR.
Structured fields
It’s also possible add custom fields to logs when the format is set to a structured form such as json
or logfmt
with the config field fields_mapping
:
Fields
level
The log level to use.
Type: string
Default: "INFO"
Options:
ERROR
, WARN
, INFO
, DEBUG
, TRACE
, ALL
.
fields_mapping
An optional Bloblang mapping that can be used to specify extra fields to add to the log. If log fields are also added with the fields
field then those values will override matching keys from this mapping.
Type: string
message
The message to print. This field supports interpolation functions.
Type: string
Default: ""