@simform_team/loggernodejs
v0.0.1
Published
It's a module to catch all the customizable log
Downloads
2
Readme
Loggerr
A very simple logger.
Features:
- Less dependency
- No Database dependency
- You can Show your log into Template Engine
- Customizzed Logging Techniques
- Always captures stack trace on error logs
Install
$ npm i @simform_team/loggernodejs
Usage
var express = require("express");
var app = express();
var loggernodejs = require("loggernodejs");
loggernodejs.init(app);
app.get("/", (req, res) => {
try {
res.send("connected");
loggernodejs.LogDebug(req, "Debug Here");
loggernodejs.LogInfo("Connected to port");
console.log("You Req Executed");
} catch (error) {
loggernodejs.LogWarn("Warn Here");
loggernodejs.LogError(error, "Can Not Get Path");
}
});
app.listen(3000, () => {
console.log("Connected on port 3000");
});
Log Levels
Each log level can be directed to a different output stream or disabled entirely. The default levels are as follows:
info
warn
debug
error
Customize Levels
You can fully customize the module with your code and also can change database locally.
UI INTEGRATION
You can also use UI which is atteched in Example folder where example project is craeted where you can see how to integrate UI and how to use it for use UI you have to Integrate all Router code.
And if you want your own customized UI and want Only data from Module you can use below mentioned function and call Data from them.
//Use In router file
const loggernodejs = require("loggernodejs");
let ErrorLogDataDebug = loggernodejs.ErrorLogDataDebug;
let ErrorLogDataWarn = loggernodejs.ErrorLogDataWarn;
let ErrorLogDataError = loggernodejs.ErrorLogDataError;
let ErrorLogDataINfO = loggernodejs.ErrorLogDataINfO;
let reqData = loggernodejs.reqData;