-
Notifications
You must be signed in to change notification settings - Fork 125
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
Setting safe: true in the options doesn't guarantee log message getting written #33
Comments
As mentioned here winston is a multi-transport async logging library for node.js. So, if you want synchronous logging you may want to use another logging library. |
Also, look issue #12 |
Yep, I realize winston is a multi-transport async logging library for node.js. But what is the point of the {safe: true} option? |
@alexyhkim log method has an optional callback argument, if you pass {safe: true} option, it will be fired only when data was guarantee written. |
When does the callback fire if you don't pass {safe: true}? Because it seemed to fire after data was written without the option as well |
@alexyhkim without {safe: true} mongodb-native callback is fired immediately (after sending data to driver) and thus doesn’t make much sense. |
Oh okay, thank you for the quick replies. |
@alexyhkim you're welcome! |
Added safe: true in the options for the MongoDB transport. Then I log a message and throw an error immediately after. Message shows up in console but not mongo. Adding handleExceptions: true also fails to log anything in mongo. I am considering implementing a custom transport with synchronous logging to mongo. Is this necessary, or am I using the transport incorrectly?
The text was updated successfully, but these errors were encountered: