logsense

0.1.2 • Public • Published

LogSense - Node Logger

npm version

LogSense is a powerful service to collect and analyze row and structured logs from your server or serverless Node.

You don't need to modify your current logging statements. We'll automatically send your messages and error or any other objects as log parameters. Row messages are auto-discovered into patterns.

Installation

  1. Run npm i logsense
  2. In your main file add:
    const logsense = require('logsense')('YOUR_LOGSENSE_CUSTOMER_TOKEN')
    logsense.install()

For Winston add:

const logsense = require('logsense')('YOUR_LOGSENSE_CUSTOMER_TOKEN')
logger.add(new logsense.WinstonTransport())

Usage

Common messages are auto-discovered into patterns:

const sendEmail = ({ address }) => {
  console.info(`Send email to ${address}`)
}
zrzut ekranu 2019-03-7 o 20 28 17

Last argument is used for structured logging:

const sendEmail = ({ address, topic }) => {
  console.info(`Send email to ${address}`, { topic })
}
zrzut ekranu 2019-03-7 o 20 32 15

Discovered and structured parameters can be used in charts: zrzut ekranu 2019-03-7 o 20 40 23

/logsense/

    Package Sidebar

    Install

    npm i logsense

    Weekly Downloads

    3

    Version

    0.1.2

    License

    none

    Unpacked Size

    12.4 kB

    Total Files

    10

    Last publish

    Collaborators

    • kryskruk