appender element.
Converters
JSON
This is the most common format converter used on xorlab. It captures all event-specific attributes. It can be used for all loggers except those recording Message Tracing Events.JSON Extended
This format converter can only be used for Message Tracing Events (numbered from 1000 to 1999). This converter records all the results of the email analysis as a single log entry. Structure:Example JSON
Example JSON
Parameters
The extended JSON can be customized through additional parameters:- Include or exclude the subject
- Add headers of the email to the JSON message.
%coreJsonMsg{param1,param2,param3,...}
As an example, the following appender pattern will not include the subject but always add the
message-id and x-custom-header header to the log message:
Specific Attributes
The%logArg{} converter allows you to log specific key-value pairs from a larger log event. This can be used for any event, in any appender, and across all xorlab components. To identify which keys to log, initially configure the appender to log the entire JSON message and inspect the structure.
Important: Always end the %logArg{} sequence with a line break (%n) to ensure proper log entry formatting.
Common Event Format (CEF)
The CEF format with its converter is used by specifying%cef in the pattern section of logback-audit.xml:
Additional converters
So far, we only used the different JSON and CEF converters in thepattern section of logback-audit.xml. However, the patterns can be enhanced with all standard Logback converters to add additional information.
Please have a look at the table at Pattern Layout to find a complete list of all standard Logback converters.
For example, the following configuration adds a date string to the logged message payload: