JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q43398F
  • License MIT

A Pino configurable logger for NodeJS to send logs to loggly and sentry

Package Exports

  • logtry

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (logtry) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Logtry

NPM

Automated Tests devDependencies Status

A Pino configurable logger for NodeJS to send logs to loggly and sentry

Requirements

Minimum Node.js version: 10

Installation

npm install --save logtry

Configuration

Key Required Description
LOGGER_NAME yes Sets the name of the logger.
LOGGER_LEVEL yes Set the minimum level of logs.
SENTRY_DSN no Sentry DSN key (sentry-doc)
LOGGLY_TOKEN no Loggly token (loggly-doc)
LOGGLY_SUBDOMAIN no Loggly subdomain (loggly-doc)

Use

// Using modules
import logger from 'logtry';
// or if using common.js
const logger = require('logtry').default;

// Log a fatal error message:
logger.fatal({ err: new Error('Fatal'), field: 'additional info' }, 'fatal message');

// Log an error message:
logger.error({ err: new Error('Error'), data: 'extra data' }, 'error message');

// Log a warning message:
logger.warn({ err: new Error('Warn'), home: 17 }, 'Warning while getting info');

// Log an informational message:
logger.info({ field: 1 }, 'info message');

// Log a debug message:
logger.debug({ user }, 'debug message');

// Log a trace message:
logger.trace({ fields: [1, 2, 66]] }, 'trace message');

MIT Licensed

Contributing

Pull requests are always welcomed. 🙇🏻‍♂️ Please open an issue first to discuss what you would like to change.

Support

If you have any questions or need help with integration, then you can contact me by email alex.abidri@gmail.com.