This Livy formatter formats log records as one-line JSON objects.
const FileHandler =const JsonFormatter =const handler = 'logs.txt'formatter:
Install it via npm:
npm install @livy/json-formatter
An object of options can be passed to this formatter's constructor.
The following options are available:
Description: Which log record properties to include in the output. The passed object is merged into the following default:
datetime: truechannel: truelevel: trueseverity: truemessage: truecontext: trueextra: true
JsonFormatter.BATCH_MODE_NEWLINES | JsonFormatter.BATCH_MODE_JSON
Description: How to store batched logs.
BATCH_MODE_NEWLINES will just put out newline-delimited JSON objects, as if log records came in sequentially.
BATCH_MODE_JSON wraps batched records in an array and outputs that.
How batched records are formatted. Initially set through the
Which log record properties to include in the output. Initially set through the