fullstack-build / tslog

📝 tslog - Universal Logger for TypeScript and JavaScript
https://tslog.js.org
MIT License
1.35k stars 63 forks source link

Feature Request: can we use asynchronous transporters? #229

Open jeanhdev opened 1 year ago

jeanhdev commented 1 year ago

I'm using Axiom and would love to know if it's possible to use tslog with an asynchronous Transporter.

In winston - it's not possible somehow, very weird.

terehov commented 1 year ago

I am not familiar with Axiom and don't quite understand the use case. Can you please provide some more context and ideally an example how you would like to use it? But I believe from what I understand it should be possible already.

CanRau commented 1 year ago

I imagine there's no async as you don't want your system to wait for logging so instead you'd use streaming

here's a tslog example https://tslog.js.org/#/?id=storing-logs-in-a-file-system-with-rotating-files and axioms API also accepts streaming data, here's an example on how to ingest a raw buffer into axiom, here you can see that you should be able to pass in a readable stream to ingestRaw and maybe the winston implementation for axiom can help