logich-file
v0.0.3
Published
logich middleware to write logs to file
Downloads
5
Maintainers
Readme
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!"
});