Giter Site home page Giter Site logo

Comments (8)

yurijmikhalevich avatar yurijmikhalevich commented on June 22, 2024

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.
By the way, this issue is related to issue winstonjs/winston#228. The key issue seems to be that WritableStreams do not guarantee flushing on process.exit() or unhandled exception.

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on June 22, 2024

Also, look issue #12

from winston-mongodb.

alexyhkim avatar alexyhkim commented on June 22, 2024

Yep, I realize winston is a multi-transport async logging library for node.js. But what is the point of the {safe: true} option?

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on June 22, 2024

@alexyhkim log method has an optional callback argument, if you pass {safe: true} option, it will be fired only when data was guarantee written.

from winston-mongodb.

alexyhkim avatar alexyhkim commented on June 22, 2024

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

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on June 22, 2024

@alexyhkim without {safe: true} mongodb-native callback is fired immediately (after sending data to driver) and thus doesnโ€™t make much sense.

from winston-mongodb.

alexyhkim avatar alexyhkim commented on June 22, 2024

Oh okay, thank you for the quick replies.

from winston-mongodb.

yurijmikhalevich avatar yurijmikhalevich commented on June 22, 2024

@alexyhkim you're welcome!

from winston-mongodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.