-
Notifications
You must be signed in to change notification settings - Fork 56
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
Transport closes before logs are shipped #44
Comments
Nice find. Might want to take a closer look at the events winston listens to. I'll come back at you, but you're welcome to submit a solution if you find one :) |
It is a bit weird though, if the |
#51 might have fixed this? |
Hi, We see this issue where the logs are not completely shipped. For reference here is the setup.
Usage in lambda
We have noticed that not all the log statements are being sent, especially the ones at the end. We think this happens because the handler shuts down after the response. Version info
|
I'm encountering this issue as well. I'm using this for scripts run by ts-node, so my workaround has been to wait for 5 seconds at the end of the script before |
I'm trying to use this transport in an AWS Lambda function and I'm finding that the function terminates before the logs are shipped to Loki.
I've noticed this issue in Winston's main repository and tried to implement this workaround in order to force the function to wait for the logger to finish shipping the logs but it does not wait for the requests to be sent before resolving the promise and closing the function.
I suspect it has something to do with this line which immediately emits a
logged
event to winston instead of waiting for the log record to be pushed, but honestly I feel I'm not familiar enough with Winston to be sure this is exactly what's happening.Could emitting the
logged
event further down the line help with the scenario I've presented?The text was updated successfully, but these errors were encountered: