@livy/stream-handler
v1.0.3
Published
Writes Livy log records to a Node.js stream
Downloads
3
Maintainers
Readme
@livy/stream-handler
This Livy handler writes log records to a Node.js stream.
Synchronous logger support: no
Runtime: Node.js
Basic Example
const { StreamHandler } = require('@livy/stream-handler')
const handler = new StreamHandler('wss://example.com/logs')
Installation
Install it via npm:
npm install @livy/stream-handler
Options
The first argument to this handler's constructor is a writable Node.js stream to write log records to.
An object of options can be passed as the second argument.
The following options are available:
bubble
Type: boolean
Default: true
Description: Controls whether records handled by this handler should bubble up to other handlers.
See also: Bubbling
formatter
Type: FormatterInterface
Default: new LineFormatter()
Description: The formatter to use.
level
Type: LogLevel
Default: 'debug'
Description: Controls which log records should be handled based on their log level.
Public API
bubble
Controls whether records handled by this handler should bubble up to other handlers. Initially set through the bubble
option.
See also: Bubbling
defaultFormatter
The formatter used by this handler if no formatter
option is set.
formatter
This handler supports formatters by implementing the FormattableHandlerInterface
.
level
The minimum log level of a log record to be considered by this handler. Initially set through the level
option.
processors
This handler supports processors by implementing the ProcessableHandlerInterface
.
reset()
This handler implements the ResettableInterface
. Resetting it resets all attached processors.
You usually don't want to call this method manually on an individual handler. Consider calling it on the logger instead.