logzio-nodejs
logzio-nodejs copied to clipboard
Close not working as expected in a lambda
Describe the bug
When running logzio in an AWS lambda I did the logger.close()
at the end of the execution as I was instructed.
However, if you close the logger and the lambda gets reused, the logger is closed and won't ship any more logs and will error with Attempt to write logs with no transports, which can increase memory usage
To Reproduce Steps to reproduce the behavior:
- Run a lambda and initialize the logger
- Run
close()
at the end of the execution as instructed per docs - Next
warm
execution of the lambda will fail logging
Expected behavior Replace close with a flush that will instruct flushing the current batch of logs
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.