@livy/uid-processor
This Livy processor adds a unique identifier to a log record's extra
object. The identifier is not unique per-record but created with the UidProcessor
instance.
Runtime: Node.js and browsers
Basic Example
const { createLogger } = require('@livy/logger')
const { UidProcessor } = require('@livy/uid-processor')
const logger = createLogger('app-logger', {
processors: [new UidProcessor()]
})
Installation
Install it via npm:
npm install @livy/uid-processor
Options
The UidProcessor
constructor takes the length of the unique identifier (in bytes, the actual identifier will be a hex string of double the length), defaulting to 7
.
Public API
reset()
This processor implements the ResettableInterface
. Resetting will generate a new identifier.
You usually don't want to call this method manually on an individual processor. Consider calling it on the logger instead.
uid
Get the generated unique identifier.