deltalogging
v0.0.4
Published
Delta Logging
Downloads
3
Readme
Logging
Node.js logging object for Delta Sonic logs data to console, log files, and syslog
Installation
npm install deltalogging
Dependencies
It has a couple of external dependencies:
- NPM - this is the node.js package manager. you'll need this to install the other dependencies.
- NodeSyslogUDP - Syslogging client for node
After installing node on your machine (assuming linux - installs for other operation systems will be similar):
npm install syslogudp
Functions
function sendError(message, err, res, connection)
This function takes a message (string), an error (object), a response object, and a mysql connection (object) and does the following:
- log the message and error to the console
- log the message and error to a file in ./Logs
- log the message and error to syslog (172.18.0.4 / 60001 UDP)
- return the message and status code 500 in the response object
- close the mysql connection
logMessage (message, logLevel)
- log the message and error to the console
- log the message and error to a file in ./Logs
- log the message and error to syslog (172.18.0.4 / 60001 UDP)