question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An useless log dir was created after calling new winston.transports.DailyRotateFile( options )

See original GitHub issue
new winston.transports.DailyRotateFile( {
    dailyrotate: true,
    filename: '/.../lib/modules/server/app/log/info-%DATE%.log',
    datePattern: 'YYYY-MM-DD',
    maxSize: '20m',
    maxFiles: '30d',
    level: 'info' }
} );

After calling the code above, an empty log dir would be created in /.../lib/server/.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LvChengbincommented, Jun 14, 2018

I tried to write a sample, but at last, I found out the reason. It isn’t because of winston-daily-rotate-file it is because of the library file-stream-rotator that being used in winston-daily-rotate-file. It created a .audit.json file for recoding a map of log files, and because I copied the directories, the .audit.json hasn’t been rebuilt, it still has the old path in it, so file-stream-rotator makes some useless directories in the old path.

Thank you for your patience.

0reactions
mdemblanicommented, Sep 9, 2018

Can this part of information about .audit.json file being created be added in the Wiki/README. It would help. I was facing a similar issue where the FileStreamRotator returned a permission error to store logs at some obscure directory, since I was running the logger initially outside docker and then inside a docker container.

Read more comments on GitHub >

github_iconTop Results From Across the Web

NodeJS Logger: winston.transports.DailyRotateFile is not a ...
I'm writing a rest api with NodeJS and express and I'm using express-winston to log accesses ...
Read more >
winstonjs/winston - Gitter
Is it possible to set up logs in such a way that the callee function uses the same logger that the caller function...
Read more >
[Solved]-Winston daily rotate file maxSize is not working-node.js
Coding example for the question Winston daily rotate file maxSize is not working-node.js. ... var transport = new (winston.transports.DailyRotateFile)({ ...
Read more >
Winston: A Logger for Just About Everything - Morioh
File({ filename: 'error.log', level: 'error' }), new winston.transports. ... You get started by creating a logger using winston.createLogger :
Read more >
How to Get Started with Logging in Node.js - Better Stack
The most common way to log in Node.js is by using methods on the console module (such as log() ). It's adequate for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found