logich-file

0.0.3 • Public • Published

logich middleware to write logs to file.

Install:

npm install logich
npm install logich-file

Usage:

var logich = require("logich");
var file = require("logich-file");

var logger = logich()
    .use(logich.object)             // Convert log message to object.
    .use(logich.time)               // Add timestamp.
    .use(logich.json)               // Format log message to JSON.
    .use(file("my-log-file.txt"));  // Add log message to file.

logger.log({
    type: "Error",
    code: 101,
    message: "Hello world!"
});

Package Sidebar

Install

npm i logich-file

Weekly Downloads

5

Version

0.0.3

License

none

Last publish

Collaborators

  • streamich