pimterry / loglevel

:ledger: Minimal lightweight logging for JavaScript, adding reliable log level methods to wrap any available console.log methods
MIT License
2.62k stars 157 forks source link

Log to a file #180

Closed brett-matson closed 2 years ago

brett-matson commented 2 years ago

Sorry, this is probably an obvious question: is there a way to get loglevel to write to a file?

Thanks in advance

pimterry commented 2 years ago

As a built-in feature, no. Loglevel intentionally doesn't include any kind of advanced features like this, it's out of scope.

It should be possible as a plugin on top of loglevel though (see https://github.com/pimterry/loglevel#plugins). From a quick google, it looks like somebody has implemented that here: https://github.com/infinum/loglevel-filesave.