-
Notifications
You must be signed in to change notification settings - Fork 885
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
next: worker-thread messages not log when pino used in both main-thread and worker-thread #1095
Comments
Ah, this looks like a bug (!). |
Removing Maybe you could send a PR? |
I do not know if I can comes up a solution. I have tested a lot of method, it seems that when ever I called It would be better to use // let pino to handle the stream flush before exit
process.emit('beforeExit')
// terminate the worker process
process.once('beforeExit', function() {
// create some time buffer for pino to clear logs
setTimeout(() => process.exit(0), 1000)
}) pino.final(logger, function() {
process.exit(0)
}) |
From my understanding, the issue is that
I don't see a way to attach a listener to the |
const { logger } = require('./b.js')
logger.info('main - show log')
logger.info('main - show log')
logger.info('main - show log')
logger.info('main - show log')
logger.info('main - show log')
logger.info('main - show log')
logger.info('main - show log')
logger.info('main - show log')
process.exit(0) The |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
When I use pino in both main-thread and worker-thread. Only the main-thread can log messages.
Repro Link: https://replit.com/@climba03003/pino-issue-1095
The text was updated successfully, but these errors were encountered: