ovhemert / pino-applicationinsights

A transport for pino that sends messages to Azure Application Insights
MIT License
10 stars 12 forks source link

CLI does not exit when upstream source dies #41

Open kf6kjg opened 3 years ago

kf6kjg commented 3 years ago

πŸ› Bug Report

The CLI logger is not exiting when the pipe closes. This leaves surrounding systems, such as PM2 or Azure WebApp, thinking the service is running when it has long since left the building.

To Reproduce

Steps to reproduce the behavior:

$ echo '{"level":50,"time":1617656797803,"pid":82,"hostname":"fd712adddba1","msg":"Test at level 50."}' | npx pino-applicationinsights --key REDACTED
logging

Alternatively with a simulated crash:

$ ( echo '{"level":50,"time":1617656797803,"pid":82,"hostname":"fd712adddba1","msg":"Test at level 50."}'; exit 1 ) | npx pino-applicationinsights --key REDACTED
logging

Observe that the logger doesn't return the prompt to the user unless terminated via signal - aka CTRL-C.

Of course a real application could be producing many more logs before exiting.

Expected behavior

The logger to send the log object to the Azure Insights service and then exit.

Your Environment

The REDACTED value in the above comes from the Application Insights Instrumentation Key line, the location of which on the Azure Portal interface is highlighted in green here: image

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kf6kjg commented 3 years ago

Lol. Last I checked it's still a bug.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kf6kjg commented 3 years ago

Yep. No actions. Not heard a peep. But do a problem.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kf6kjg commented 2 years ago

Go away stale bot.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

kf6kjg commented 2 years ago

I said go away bot. :P

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.