Closed Simran-B closed 6 years ago
hi @Simran-B morgan
does not implement any kind of file writing. This module accepts a stream
option where it will write your logs out to a stream. You can use things like a transform stream to do transformations like compression on the data or file rotation, though this is all outside of morgan
directly.
It would be really handy if morgan could compress the logs on the fly or zipped them automatically on rotation.
winston-daily-rotate-file calls such an option zippedArchive: A boolean to define whether or not to gzip archived log files. (default 'false')
They seem to compress the logfile in one piece on rotation:
I guess it would be too risky to use on-the-fly compression because in case of an abrupt process termination the file could be rendered invalid...