Socket
Socket
Sign inDemoInstall

winston-couchdb-transport

Package Overview
Dependencies
70
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    winston-couchdb-transport

A simple Winston transport for Couchdb Db


Version published
Weekly downloads
6
decreased by-68.42%
Maintainers
1
Install size
9.78 MB
Created
Weekly downloads
 

Readme

Source

CouchDb NoSQL DB Transport for Winston

The winston-couchdb-transport module allows you to log your winston messages to CouchDB NoSQL DB. Cloned from the Winston-Cloudant-Transport by Håkan Öström.

const winston = require('winston');
const WinstonCouchdb = require('winston-couchdb-transport');

const logger = winston.createLogger({
    transports: [
        new couchdbTransport({
            url: '...',
            db: '...'
        })
    ]
});

Installation

  $ npm install --save winston-couchdb-transport

Usage

Winston-couchdb-transport is just like any other transport for winston. When adding it to winston, it takes some options so that it knows where to log to CouchDB.

Note that the latest version of this transport is made for winston 3.0 and up. If using older version of winston, please use older version (1.x) of this library.

The Cloudant NoSQL DB transport takes the following options:

host        : Access url to db. Including "http://" or "https://"
username    : Username for the CouchDB instance
password    : Password for the CouchDB instance
db          : Name of the databasename to put logs in
logstash    : Write logs in logstash format

host

The host address for a CouchDB DB instance can be retreived from your CouchDB admin interface.

username

The username for a CouchDB DB instance can be retreived from your CouchDB admin interface

password

The password for a CouchDB DB instance can be retreived from your CouchDB admin interface

db

The name of the database where logs should be writen. Default if none priveded is winston-couchdb.

logstash

True or false indicating logs to be writen in logstash format. Default is false.

Result

In your CouchDB instance a new database will be created with the specified name containing a new document for each log. The timestamp will be in the root level of the document and thus aid in sorting. The child node params will vary in formatting depending on the logstash flag but always contain the log itself along with some metadata.

Author

Written by Emil Brolin and Håkan Öström

Keywords

FAQs

Last updated on 25 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc