question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Node Process Won't exit

See original GitHub issue

I’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:closed
  • Created 9 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
typedefstructercommented, Apr 22, 2017

just one doubt, what is the point of closing after connect, then how Will i send logs to papertrail?

0reactions
leorossicommented, Dec 13, 2014

@kenperkins Thanks for the fix and the explanation! 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found