Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.28 KB

winston-errsole.md

File metadata and controls

55 lines (37 loc) · 1.28 KB

Winston with Errsole

If you are already using Winston for logging in your Node.js project and want to integrate it with Errsole, you can do so by using the winston-errsole transport. This transport streams your Winston logs to Errsole.

Steps

  1. Add the winston-errsole transport in your Winston logger to stream logs to Errsole.
  2. Setup Errsole to receive and store logs from your winston-errsole transport.

Example

npm install winston winston-errsole
npm install errsole errsole-sqlite
// Add `winston-errsole` transport
const winston = require('winston');
const WinstonErrsole = require('winston-errsole');

const logger = winston.createLogger({
  level: 'debug',
  transports: [new WinstonErrsole()]
});

// Setup Errsole
const errsole = require('errsole');
const ErrsoleSQLite = require('errsole-sqlite');

errsole.initialize({
  storage: new ErrsoleSQLite('/tmp/logs.sqlite')
});

module.exports = logger;

Errsole Setup

File-based Logging

Centralized Logging

Main Documentation

Main Documentation