book-file
file transport for book logging framework
Last updated 9 years ago by shtylman .
Repository · Original npm · Tarball · package.json
$ cnpm install book-file 
SYNC missed versions from official npm registry.

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 created
var log = require('book').default();

// adds the file logging middleware to the logger
log.use(require('book-file')({
    filename: '/path/to/file.log'
});

// log stuffs, it will go to the log file
log.info('hello world!');

file.log will contain something along the lines of:

{ "level": 3, "timestamp": 12345, "message": "hello world!" }

Current Tags

  • 0.0.1                                ...           latest (9 years ago)

1 Versions

  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |