Node Process Won't exit
See original GitHub issueI’m testing the winston-papertrail with this simple code:
var winston = require('winston');
require('winston-papertrail').Papertrail;
var tr = new winston.transports.Papertrail({
host: 'my-server.papertrailapp.com', // this is actually the right host
port: 94573, // this is actually the right port
});
var Logger = new winston.Logger({
transports: [] // <--- yes, not an error, I'm NOT adding the transport to winston
});
Logger.info("Hello world!!! " + new Date().getTime());
If I run this code the node process won’t exit because of the connection to Papertrail server. Is there any way to force close the pending connection?
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
my nodejs script is not exiting on its own after successful ...
The problem with just using process.exit() is that the program I am working on was creating handles, but never destroying them.
Read more >How to Exit a Process in Node.js: process.exit() Method
If your Node.js process is not terminated properly, you can use the exit() function to terminate it forcefully. You need to do this...
Read more >When stopping a node application, event 'exit' never fired
1. Create a node app with a listener process.on('exit', function(){ console.log('Exiting'); }); · 2. Run the app. · 3. Press the stop button...
Read more >Process - node - Read the Docs
Node will normally exit with a 0 status code when no more async operations are pending. The following status codes are used in...
Read more >How to Exit in Node.js - Stack Abuse
Exiting from a Node.js program started at the command line can be as simple as waiting for the script to finish executing. Implicitly,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
just one doubt, what is the point of closing after connect, then how Will i send logs to papertrail?
@kenperkins Thanks for the fix and the explanation! 👍