It appears that if the connection to Logentries fails, waiting logs are pushed on to an in-memory queue. When the connection starts working again, the queue is flushed.
However, I see no bound on the queue size. Eventually the memory growth of buffered logs could exhaust system memory and cause a crash, taking the buffered logs with it.
The issue could be addressed by putting a limit on the queue size, and making sure that buffered logs beyond the queue size are logged to STDERR as a backup option. This is generally approach that the official Logentries client](https://github.com/logentries/le_node) takes.
@markstos thanks for such a clear report and your interest.
If we bump the dependency to le_node I think that would produce the effect you are looking for.
The internal lib is https://github.com/rjrodger/node-logentries which now directs to le_node.
TBH this could do with a some house keeping anyway.
Updated here 22e15c7
The stream now emits errors which according to this documentation you can put to stderr as you suggested.
k I am going to close this off as the patch answers the original issue