Envelope¶
This formatter adds content to the beginning and/or end of a message.
Parameters¶
Prefix
Defines a string that is added to the front of the message. Special characters like n r or t can be used without additional escaping. By default this parameter is set to “”.
Postfix (default: n)
Defines a string that is added to the end of the message. Special characters like n r or t can be used without additional escaping. By default this parameter is set to “n”.
Parameters (from core.SimpleFormatter)¶
ApplyTo
This value chooses the part of the message the formatting should be applied to. Use “” to target the message payload; other values specify the name of a metadata field to target. By default this parameter is set to “”.
SkipIfEmpty
When set to true, this formatter will not be applied to data that is empty or - in case of metadata - not existing. By default this parameter is set to false
Examples¶
This example adds a line number and a newline character to each message printed to the console.
exampleProducer:
Type: producer.Console
Streams: "*"
Modulators:
- format.Sequence
- format.Envelope