winston-rotating-file
Description
Transport for winston based on rotating-file-stream.
Usage
const WinstonRotatingFile = ;const winston = ; const logger = winston;
or (if access to rotating-file-stream events is required)
const WinstonRotatingFile = ;const winston = ; const transport = filename: "file.log" rfsOptions: size: "10M" // rotate every 10 MegaBytes written interval: "1d" // rotate daily compress: "gzip" // compress rotated files ; transportstream; const logger = winston;
Installation
With npm:
$ npm install --save winston-rotating-file
API
const WinstonRotatingFile = ;
new WinstonRotatingFile(options)
Creates the Transport for winston. Accepts all options for winston-transport (please refer to winston for details) plus following specific options:
filename
(required)rfsOptions
both of them passed to
rfs.createStream
, please refer
to rotating-file-stream for detailed options description.
TypeScript
Check index.d.ts
for what is exported in
TypeScript.
Compatibility
Requires Node.js v10.x.
The package is tested under all Node.js versions currently supported accordingly to Node.js Release.
Licence
Bugs
Do not hesitate to report any bug or inconsistency @github.
Donating
If you find useful this package, please consider the opportunity to donate some satoshis to this bitcoin address: 12p1p5q7sK75tPyuesZmssiMYr4TKzpSCN