# winston-couchdb-transport

> A simple Winston transport for Couchdb Db

Latest version **2.1.7** (published 2020-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install winston-couchdb-transport
pnpm add winston-couchdb-transport
yarn add winston-couchdb-transport
bun add winston-couchdb-transport
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.7 |
| Published | 2020-05-25 |
| First published | 2020-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 8.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Emil Brolin |
| Maintainers | goveebee |
| Keywords | logging, tools, winston, couchdb |

## Links

- npm: https://www.npmjs.com/package/winston-couchdb-transport
- Repository: https://github.com/goveebee/winston-couchdb-transport
- Homepage: https://github.com/goveebee/winston-couchdb-transport#readme
- Issues: https://github.com/goveebee/winston-couchdb-transport/issues
- npm.io page: https://npm.io/package/winston-couchdb-transport

## Dependencies (3)

- [nano](https://npm.io/package/nano.md) ^8.2.2
- [lodash](https://npm.io/package/lodash.md) ^4.17.14
- [winston-transport](https://npm.io/package/winston-transport.md) ^4.3.0

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.1.7 (latest) — 2020-05-25

## README

# 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

``` bash
  $ 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](http://www.governor.se) and [Håkan Öström](http://www.hakanostrom.se)

---
_Source: https://npm.io/package/winston-couchdb-transport · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
