0.1.2 • Published 5 years ago

logsense v0.1.2

Weekly downloads
13
License
-
Repository
github
Last release
5 years ago

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}`)
}

Last argument is used for structured logging:

const sendEmail = ({ address, topic }) => {
  console.info(`Send email to ${address}`, { topic })
}

Discovered and structured parameters can be used in charts: