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

App doesn't exit when I use this library #60

Open
bmaupin opened this issue Sep 29, 2021 · 0 comments
Open

App doesn't exit when I use this library #60

bmaupin opened this issue Sep 29, 2021 · 0 comments

Comments

@bmaupin
Copy link

bmaupin commented Sep 29, 2021

Oddly enough, I ran across this exact same problem testing winston-syslog: winstonjs/winston-syslog#155

If I test bunyan by itself, then this code runs and exits normally:

const bunyan = require('bunyan');

const logger = bunyan.createLogger({
  name: 'graylog-syslog-bunyan',
});

logger.error('Test message');

However, when I use this library, the app no longer exits:

const bunyan = require('bunyan');
const bsyslog = require('bunyan-syslog');

const logger = bunyan.createLogger({
  name: 'graylog-syslog-bunyan',
  streams: [
    {
      level: 'debug',
      type: 'raw',
      stream: bsyslog.createBunyanStream({
        host: '127.0.0.1',
        port: 5140,
      }),
    },
  ],
});

logger.error('Test message');

Instead, I have to manually exit:

setTimeout(() => {
  process.exit();
}, 500);

Some more information in case it helps:

$ node --version
v14.17.5
$ grep bunyan package.json
    "bunyan": "^1.8.15",
    "bunyan-syslog": "^0.3.3",

Thanks!

bmaupin added a commit to bmaupin/graylog-syslog-examples that referenced this issue Sep 29, 2021
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

1 participant