Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shelfio/winston-datadog-logs-transport
Winston transport for Datadog Logs (not events)
https://github.com/shelfio/winston-datadog-logs-transport
datadog logging nodejs npm-package winston winston-transport
Last synced: 8 days ago
JSON representation
Winston transport for Datadog Logs (not events)
- Host: GitHub
- URL: https://github.com/shelfio/winston-datadog-logs-transport
- Owner: shelfio
- License: mit
- Archived: true
- Created: 2019-01-24T10:18:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-02-18T09:59:37.000Z (almost 4 years ago)
- Last Synced: 2024-12-27T08:32:08.757Z (about 1 month ago)
- Topics: datadog, logging, nodejs, npm-package, winston, winston-transport
- Language: JavaScript
- Size: 74.2 KB
- Stars: 13
- Watchers: 24
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# winston-datadog-logs-transport ![](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)
> Winston transport for Datadog Logs (not events)
There are 3 winston transports for Datadog on NPM:
[1](https://github.com/sparkida/winston-datadog),
[2](https://github.com/kioannou/winston-datadog-logger),
[3](https://github.com/outwithreality/winston-datadog-transport).**All of them send data to [Datadog Events](https://docs.datadoghq.com/getting_started/#events) instead of [Datadog Logs](https://docs.datadoghq.com/logs/?tab=usregion)**.
This package actually is a transport for Datadog Logs, not Events.## Install
```
$ yarn add @shelf/winston-datadog-logs-transport
```## Usage
```javascript
import winston from 'winston';
import DatadogTransport from '@shelf/winston-datadog-logs-transport';const logger = winston.createLogger({
transports: [
new DatadogTransport({
apiKey: process.env.DD_API_KEY, // Datadog API key
port: 443, // optional port, 443 is for EU region secure port
host: 'tcp-intake.logs.datadoghq.eu', // optinal host, 'tcp-intake.logs.datadoghq.eu' is for EU region host
// optional metadata which will be merged with every log message
metadata: {
ddsource: 'lambda',
environment: 'prod'
}
})
]
});logger.info('Hey there', {thisIsMy: 'metadata'});
```## Publish
```sh
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
```## License
MIT © [Shelf](https://shelf.io)