Feature Request: [Feature] Consider expanding tslog so that it can become the go to logging framework for Node
See original GitHub issueWinston and Pino are both written in JS with minimal to no typings. Winston is limping on but gets no real attention from the maintainers, it also can’t do basic things such as logging metadata to the console in certain scenarios (such as pretty printing). Both lack real world “enterprise” grade logging features that other languages/ecosystems have available.
The one feature they both have that tslog does not have though, is dedicated transports for log files. If tslog could be extended to support such capabilities that other logging frameworks have such as:
- File transport
- File rotation
- Archiving log files to .zip file
Then I think tslog would be positioned in a really nice place. Currently the choice comes down to either picking Winston and having little chance of fixes or new features, or Pino and having no official typings (and also all the docs are still showing require
in 2022). I personally believe tslog can be the basis for a modern logging framework if it adds official file transport. The community could contribute the other types of transports they desire such as databases etc.
I know the docs show an example of logging to a file but it doesn’t have retries, buffering, or log file rotation like a real world one would. Developers may not be comfortable developing their own safe file transport as it’s not a simple task and has edge cases and unit testing to consider. IF tslog provides this out of the box, developers and organisations could use tslog immediately.
What do you think? Maybe sponsorship of the library could help develop this?
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:5 (4 by maintainers)
Hello @lloydjatkinson
thank you very much for your kind words. I am indeed looking to allocate more time to tslog and already started working on version 4.0. For now it has only been a side project of mine, but I’ve been thinking of ways to change that and feedback like yours is super valuable. Are you open to discuss it directly? Would be great to hear your experiences.
PS: I indeed thought about adding a donation button.
Hi, that’s great to hear! It’s a really good effort for saying it’s a side project 😀
Yep I’m free to discuss this any time that suits you! In the meantime I also found this https://www.npmjs.com/package/rotating-file-stream which seems to be very well tested and also written in TS. Perhaps this could be used for the transport?
Edit: It’s also worth mentioning having console and file transport usually implies possibly different verbosity/format/levels per transport. For example logging everything to a file in json format but only logging warn and error and fatal to console in pretty format.