new RedisEventCache(options)
Custom Redis "Event" logging transport for Winston.
Internally, it uses Redis' built-in pub/sub messaging feature to notify its listener method when the cache is ready to be purged.
You would log SOME_EVENT type events to the table "test_events" using the following
call to the log method:
logger.log("info", msg, {type: "SOME_EVENT, val2: "a val", val2: "another val"})IMPORTANT: If the meta key type is not found, or the given type is not configured in the
provided config file, the event will be ignored in this transport.
Parameters:
| Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | options object Properties
|
- Source:
Methods
log(level, msg, meta, callback)
Base logger method.
Ignores any messages without type field present in meta object, or with
a type not configured in this.event_types.
Otherwise, parses log message and metadata and sends to this._addRowtoCache, where all the caching logic is taken care of.
NOTE: also augments all loglines with "hostname" field
Parameters:
| Name | Type | Description |
|---|---|---|
level |
||
msg |
||
meta |
||
callback |
- Source: