@drykovhit/winston-logflare
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

winston-logflare

This module provides a transport for winston logger that forwards messages to Logflare app.

Installation

$ npm install @drykovhit/winston-logflare

Usage example

const winston = require("winston")
const LogflareTransport = require("winston-logflare")

const apiKey = "..."
const sourceToken = "..."

const logger = winston.createLogger({
    level: "info",
    format: winston.format.json(),
    defaultMeta: {env: "staging"},
    transports: [
        new LogflareTransport({
            apiKey,
            sourceToken,
            batchMaxSize: 1, // optional config setting
            batchFlushInterval: 1000, // optional config setting
        }),
    ],
})

logger.log("info", "info message", {property: "value"})
logger.log("error", "Error occured!")

License

Licensed under MIT.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.4
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.4
    0
  • 0.1.3
    0
  • 0.1.2
    0

Package Sidebar

Install

npm i @drykovhit/winston-logflare

Homepage

logflare.app

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

14.7 kB

Total Files

8

Last publish

Collaborators

  • drykov