Logger

The NPM package provide an easy to use Logger system.

To use the Logger, you have to setup the core before.

Publish Logs with CORE

Using the core, you can easily setup up multiple logger for each part of you application and publish every essential information to the Dashboard.

const logger = new Logger({
    shouldDisableRemoteLogging: false, // Can be set to true on local development env
});

// By calling this method, you will automatically send a log in the console and publish it to the Abyss Monitor Dashboard
logger.log('This is my first log');
logger.error('This is my first error log');
logger.warn('This is my first warn log');
logger.info('This is my first info log');

// Debug is similar to log but it's automatically save the stack trace
logger.debug('This is my first debug log');

// Advanced log
logger.error(error, {
      context: "Mon Context",
      scenario: "My Scenario",
      // getRequestContext is an easy to use tool to get the current RequestId of your API
      // Please check the Express Middleware setup before using it
      requestId: getRequestContext().requestId,
});

The Logger allow multiple options, please check package to get the complete list.

Last updated