npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rhodeslogger

v1.0.3

Published

This module will use for handling error,log,debug,event and warning and saving into MS-SQL database based on configuration

Downloads

3

Readme

General file information

##--

Use this module for getting the request for logging the data from the main application.

It containing the database server call using the procedure containing the parameters to logged the log data into the database server.

It uses the some primary columns like logTime,logdescription ,logType etc.

Configuration file is maintain for connection to database and also for other future purpose.

feature/loggerModule

Configuration file information

-For database configuration need MSSQL which is mentioned in the config file.

var config = { sqlConfiguration: { user: '', password: '', server: '', database: '', } ##-- ##--

logConfiguration and logType is set in the config file.

-logConfiguration decide data to logged into the server or not on the basis of true and false.

-incase of error configuration does't matter, it will log.

logConfiguration: { isError: true, isInfo: true, isWarning: true, isDebug: true, isEvent: true }, logType: { error: "ERROR", info: "INFO", warning: "WARNING", debug: "DEBUG", event: "EVENT" } ##-- ##--

logger module implementation

-we can implement this module as a service or module

-service implementation

we have to create a server and deploy.

var restify = require('restify'), rhodeslogger = require("./index"), configuration = require(__dirname + "\config"), port = configuration.listeningPort, ip = configuration.listeningIP;

var server = restify.createServer({ name: "rhodeslogger" });

server.use(restify.queryParser()); server.use(restify.bodyParser()); server.use(restify.CORS());

this is code snippet for module implementation.

##-- rhodeslogger.isWriteLog("INFO",{welcome:'welcome'},function(data){ console.log(data) })

##--

below snippet for module implementation like web service

below method will log data without verifying config.logConfiguration property

server.post({path: '/logger', version: '0.0.1'}, function (req, res, well) { try { var bodyOfRequest = JSON.parse(req.body); //Checks the supplied value if null or empty. var logType = (bodyOfRequest.logType ? bodyOfRequest.logType : "ERROR"); var data = (bodyOfRequest.data ? JSON.stringify(bodyOfRequest.data) : "{}"); rhodeslogger.writeLog(logType, data); res.json({status: true}); } catch (err) { res.json({status: false, errorMessage: err.message}); } });

below method will log data based on config.logConfiguration property

server.post({path: '/isLogger', version: '0.0.1'}, function (req, res, well) { try { var bodyOfRequest = JSON.parse(req.body); //Checks the supplied value if null or empty. var logType = (bodyOfRequest.logType ? bodyOfRequest.logType : "ERROR"); var data = (bodyOfRequest.data ? JSON.stringify(bodyOfRequest.data) : "{}"); rhodeslogger.isWriteLog(logType, data); res.json({status: true}); } catch (err) { res.json({status: false, errorMessage: err.message}); } });