Fix an issue where the Graylog2 transport ignores requests
from Winston to close the transport. This causes applications
depending on Winston's close() functionality to hang.
Winston has a feature where transports can support the .close()
call, which is called when a program calls .close() on the
Winston logger instance. Transports can use this method to
release their resources and shut down gracefully.
This pull request uses this feature to close the Graylog2 connection
when Winston is cleaning up.
Caveat: currently there is no way to pass Graylog2's close()
callback to Winston, since Winston does not support this.
Fix an issue where the Graylog2 transport ignores requests from Winston to close the transport. This causes applications depending on Winston's close() functionality to hang.
Winston has a feature where transports can support the
.close()
call, which is called when a program calls.close()
on the Winston logger instance. Transports can use this method to release their resources and shut down gracefully.This pull request uses this feature to close the Graylog2 connection when Winston is cleaning up.
Caveat: currently there is no way to pass Graylog2's close() callback to Winston, since Winston does not support this.