axiomhq / axiom-js

Official language bindings and library extensions for Axiom
https://axiom.co
MIT License
97 stars 14 forks source link

Make flush() public #213

Closed CamTosh closed 2 months ago

CamTosh commented 2 months ago

The support team send me this sample but it can't work ts: Property 'flush' is private and only accessible within class 'WinstonTransport'.

  // Ensure logs are flushed before the process exits
  process.on('beforeExit', () => {
    axiomTransport
      .flush()
      .then(() => {
        console.log('Logs flushed successfully');
      })
      .catch((error) => {
        console.error('Error flushing logs:', error);
      });
  });
}