logzio-nodejs icon indicating copy to clipboard operation
logzio-nodejs copied to clipboard

Close not working as expected in a lambda

Open cipriancaba opened this issue 2 years ago • 0 comments

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:

  1. Run a lambda and initialize the logger
  2. Run close() at the end of the execution as instructed per docs
  3. 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.

cipriancaba avatar Nov 18 '22 08:11 cipriancaba