book-file is a file transport for the book logging framework. It will write out the json contents of the log entry.
installation
npm install book-file
use
book-file is used like all other book middleware. Just add it to your logger object. I recommend you create a file log.js
for your project where you setup the logger however you desire across your entire project.
// some logger you have createdvar log = ; // adds the file logging middleware to the loggerlog
file.log will contain something along the lines of:
{ "level": 3, "timestamp": 12345, "message": "hello world!" }