Node.js Library Documentation

To simplify adding JustLog.IT logging into your Node.js applications we built a wrapper library.

Getting Started

Follow these steps to get our node.js library installed and running in your node.js application.

1. Install the node.js library
npm install justlogit --save
2. Reference the logging library
var Logger = require('justlogit');
3. Create a global logging instance
global.logger = new Logger('token');
Setting a global instance allows you to automatically reference the logging library from anywhere in yourapplication using the syntax: global.logger.logError(obj);


This is the list of methods on the logging interface you can call to store values from your running web application.

  • method - the name of the method being tracked
  • timing - the number of milliseconds the action took
  • user - (optional) a user marker
  • details - (optional) any additional details for the log entry
Logs a performance record. Performance is calculated by taking the start and endtimestamps (Date objects) and getting the millisecond difference between them.
  • name - the name of the event
  • description - (optional) any additional details about the event
  • user - (optional) a user marker
Logs an event occurrence for the application.
  • err - the error object caught in your try/catch block. This should be a fullypopulated object with all the fields set up, including a user marker if you need that.
Logs the details of an error. The error object is expected to have thedefault error object properties (message and stack)
  • method - the name of the method being tracked
  • user - (optional) a user marker
  • details - (optional) any additional details for the log entry
Writes an information log entry into the system. These are useful to provide context to otherentries, especially errors.

How it Works

The node library is designed to be as light-weight as possible. To that end all the methods listed above employ"fira and forget" execution. You call the method and it executes asynchronously but the do not have a callback method to return results. So just call the method with the required parameters and let your code continue executing. That does make it impossible to use the logging to control code execution flow but that has not been a problem so far.

This library uses the standard http(s) libraries that come with node to execute the calls. The error logging executesa POST to the log collector. The other 3 methods execute a GET request.

Get started with two months free.