winston-firehose
Version:
Winston logging transport for logging into Amazon AWS Firehose.
49 lines (48 loc) • 1.62 kB
TypeScript
import { FirehoseClientConfig } from "@aws-sdk/client-firehose";
import { TransportStreamOptions } from "winston-transport";
import { MessageSender } from "./interfaces";
export type FormatterFunc = (message: any) => string;
export declare const DefaultFormatter: FormatterFunc;
export type FirehoseTransportOptions = TransportStreamOptions & {
/**
* Kinesis delivery stream name.
*
* @type {string}
*/
streamName: string;
/**
* If set to true, the Kinesis Transport logger stream will inherit the logger's
* overall log level. Otherwise the log level will default to 'info'.
*
* @type {boolean}
*/
useLoggerLevel?: boolean;
/**
* If set to true, the Kinesis Transport log format will be inherited from the
* overall logger's format specifcation. Otherwise, the log formatter will default
* to JSON.stringify, and appends a timestamp.
*
* @type {boolean}
*/
useLoggerFormat?: boolean;
/**
* Specify a custom formatter function. This overrides the behavior
* of useLoggerFormat.
*
* @type {FormatterFunc}
*/
formatter?: FormatterFunc;
/**
* Passes through these parameters directly to the Amazon AWS Firehose SDK.
* These options are documented {@link http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Firehose.html#constructor-property | here}.
*
* @type {FirehoseClientConfig}
*/
firehoseOptions?: FirehoseClientConfig;
/**
* Injector parameter for mocking and testing.
*
* @private
*/
firehoseSender?: MessageSender;
};