🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

book-file

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

book-file

file transport for book logging framework

latest
Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
4
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

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!" }

FAQs

Package last updated on 10 May 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts