Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to log to file with DailyRotateFile #16

Closed
mattberther opened this issue Mar 10, 2016 · 3 comments
Closed

Fails to log to file with DailyRotateFile #16

mattberther opened this issue Mar 10, 2016 · 3 comments

Comments

@mattberther
Copy link
Member

Originally reported by @Efreak at winstonjs/winston#468

I see that issue was supposedly fixed with the File transport, however I'm having it with DailyRotateFile transport. I'm testing functionality, and it's failing. There's a simple example listed below. For my actual use case, check this trigger for my node-steam-chat-bot.

obscured@obscured:~/old-chatbots$ node
> var winston = require('winston');
undefined
> var logger = new winston.Logger;
undefined
> var b = logger.add(winston.transports.DailyRotateFile, { //don't spam me!
... level: "warn",
... colorize: false,
... timestamp: false,
... filename:'bot.corny.log',
... datePattern:"yyyy-MM-dd-m",
... json:false
... });
undefined
> logger.info("test test");
undefined
> obscured@obscured:~/old-chatbots$ ls bot.corny*
ls: cannot access bot.corny*: No such file or directory
obscured@obscured:~/old-chatbots$
@ghost
Copy link

ghost commented Jun 20, 2016

Not really sure why this is happening, but I'm just now hitting this as well. Can't figure out why my log file isn't getting created.

@ghost
Copy link

ghost commented Jun 20, 2016

For me, I switched around my transport creation. If I create a daily-rotate-file transport first, followed by a console transport, my output would never log to a file. Switching my code so that I create a console transport first, followed by the rotate file, then everything logs to a file just fine.

I'll try to create a small working example and submit it later.

@mattberther
Copy link
Member Author

Closing due to lack of response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant