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

Node application hangs #51

Closed
ejbrennanjr opened this issue Apr 1, 2015 · 1 comment
Closed

Node application hangs #51

ejbrennanjr opened this issue Apr 1, 2015 · 1 comment

Comments

@ejbrennanjr
Copy link

Hello -
I am using winston-mongo v1.1.0.
I have a simple app.js that runs a few .log commands. Initially, I did this just using Winston native file and console based transports. This worked fine. The app starts up, logs to the file/console, and shuts down normally. But, when I require winston-mongo in my app.js and add it as a transport, when I run the otherwise same app.js the node application successfully logs to Mongo but does not shut down. I have to ctrl-c to end the process. Can you provide any insight to what I'm doing wrong?

  • EJB
@yurijmikhalevich
Copy link
Member

Hi, @ejbrennanjr.

You are doing everything fine. This happens because winston-mongodb is an asynchronous module and MongoDB connection is persistent. If you want to shut down your application, please, close your mongodb connection or destroy winston-mongodb instance.

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

2 participants