-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
transports.File not writing to file #1001
Comments
I'm having the same problem. |
I don't recall, but I remember running into an issue where the file and/or directory didn't exist already. Winston won't create the directory for you, it needs to already exist. |
having same issue. any news on this? |
@mhawila nope, wrote my own logger. |
I'm encountering the same issue. |
At first this log to both console and file, but the next hour it doesn't write to file, but still log to console. Any Idea? Set
Resolve my problem, I think because winston exit with no status code. |
I had encountered with same issue and looks like winston failed to handle relative path. For an example, winston failed to create file when i use Hope it will help! |
whats wrong with this repo, i don't want use it any more~! |
I think it has something to do with the path you set for filename . Otherwise , use duplicate #875 |
duplicate to #1465 |
I'm not sure what's specifically causing it, but what caused this for me was I was running a synchronous script that has heavy synchronous read and writes, which also encountered file system errors: "EISDIR: illegal operation on a directory, read" When the error was there (the script carried on for a little while afterword), the script exited too fast for the logs to be flushed and the files were never written. Without the error, even though it was the exact same script, the logs are created. Here are some documented ways to get around this: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md#winstonlogger |
I'm having the same issue with
I get the expected console output from info, warn, and error but not colorized. But there are no log files in the root dir.
Edit:Just fixed the console color output with:
|
I know this is a long time ago, but had this issue. However, I realized the file location wasn't being resolved. This might work.
|
I have winston 3.3.3 installed and working properly in local both for logging in console and a file, but when I deploy on heroku it does not log anything neither in console nor file. I dont know if this issue is related to winston or heroku |
This is probably a privilege thing, where the user/agent who executes the
code, doesn't have file permissions to write the logs.
I had this issue once where the log file whos created with root. So this
log file was then also owned by root and coudn't be overwritten with normal
user privileges.
… I have winston 3.3.3 installed and working properly in local both for
logging in console and a file, but when I deploy on heroku it does not log
anything neither in console nor file. I dont know if this issue is related
to winston or heroku
|
I'm not sure if this is a privilege thing. There is a paragraph in this page about this problem I think. some add-on for heroku called coralogix may work with winston: Node.js Logging Libraries |
Actually it does log in heroku log console. Problem is still logging to a file (in local no problem) |
I know this was already asked, several times, but either there was no fix, or it just got closed.
$ npm -v
4.4.4
winston: 2.3.1
My logger:
The console transport works fine when calling e.g.
But the file transport refuses to work. It doesn't matter if the file exists or not.
It worked fine when I used the default logger
winston.log('error', 'bla', someThing);
.I also invoke the onLogging event:
The text was updated successfully, but these errors were encountered: