Skip to content

Commit

Permalink
Add Parseable transport
Browse files Browse the repository at this point in the history
  • Loading branch information
nitisht authored May 16, 2024
1 parent d567c57 commit 0128aa3
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ there are additional transports written by
* [MySQL](#mysql-transport)
* [New Relic](#new-relic-agent-transport)
* [Papertrail](#papertrail-transport)
* [Parseable](#parseable)
* [PostgresQL](#postgresql-transport)
* [Pusher](#pusher-transport)
* [Sentry](#sentry-transport)
Expand Down Expand Up @@ -732,6 +733,33 @@ The Papertrail transport connects to a [PapertrailApp log destination](https://p

*Metadata:* Logged as a native JSON object to the 'meta' attribute of the item.

### Parseable Transport

[Parseable](https://parseable.com/) is an open source, general purpose log analytics system. [Parseable-Winston](https://github.com/jybleau/parseable-node-loggers/tree/main/packages/winston#parseable-winston) is a Parseable transport for Winston.

```js
// Using cjs
const { ParseableTransport } = require('parseable-winston')
const winston = require('winston')

const parseable = new ParseableTransport({
url: process.env.PARSEABLE_LOGS_URL, // Ex: 'https://parsable.myserver.local/api/v1/logstream'
username: process.env.PARSEABLE_LOGS_USERNAME,
password: process.env.PARSEABLE_LOGS_PASSWORD,
logstream: process.env.PARSEABLE_LOGS_LOGSTREAM, // The logstream name
tags: { tag1: 'tagValue' } // optional tags to be added with each ingestion
})

const logger = winston.createLogger({
levels: winston.config.syslog.levels,
transports: [parseable],
defaultMeta: { instance: 'app', hostname: 'app1' }
})

logger.info('User took the goggles', { userid: 1, user: { name: 'Rainier Wolfcastle' } })
logger.warning('The goggles do nothing', { userid: 1 })
```

### PostgresQL Transport

[@pauleliet/winston-pg-native](https://github.com/petpano/winston-pg-native) is a PostgresQL transport supporting Winston 3.X.
Expand Down

0 comments on commit 0128aa3

Please sign in to comment.