Compression Issues on Windows
See original GitHub issueMy deployment environment is linux, however I am working on development in Windows; my code might work in linux, but it’s certainly not working on Windows and having unusual behavior.
I tried setting compress to true, and had problems… but then I realized that perhaps my Windows installation didn’t have the compression binaries that rotating-file-stream is expecting, so I overrode it with my own function and having the same problem:
let compressFunction = (source, dest) => 'tar -czf "' + dest + '" "' + source + '"';
if (accessLogging) {
let accessLogStream = rfs(accessLogName, {
interval: '60s',
compress: compressFunction,
path: path.join(accessLogPath, accessLogName)
})
app.use(morgan(accessLogFormat, { stream: accessLogStream }))
}
When compress isn’t enabled, it rotates as expected. However with compress specified as above, the files that are written do appear to be blank (pre-compression) and then aren’t actually compressed.
It appears when it’s trying to compress the files, it’s executing the temporary file itself, as I get a prompt to “Choose app to open SUCHANDSUCH.tmp” at the interval about on par with what I have specified.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Thanks, keep me apprised.
On Wed, Jun 19, 2019, 10:38 Daniele Ricci notifications@github.com wrote:
Hi @Alpha4615 ,
I just released v2.0.0, it should be fully Windows compliant (at least all tests are now OK).
Hope this helps.