https://github.com/manbearwiz/winston-datadog-browser
Send winston logs to Datadog via the browser logs SDK.
https://github.com/manbearwiz/winston-datadog-browser
browser datadog logging npm winston winston-logger winston-transport
Last synced: 5 months ago
JSON representation
Send winston logs to Datadog via the browser logs SDK.
- Host: GitHub
- URL: https://github.com/manbearwiz/winston-datadog-browser
- Owner: manbearwiz
- License: mit
- Created: 2021-09-08T16:00:01.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-11-20T03:13:08.000Z (7 months ago)
- Last Synced: 2025-11-20T03:22:07.987Z (7 months ago)
- Topics: browser, datadog, logging, npm, winston, winston-logger, winston-transport
- Language: TypeScript
- Homepage:
- Size: 535 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# winston-datadog-browser
[](https://www.npmjs.com/package/winston-datadog-browser?activeTab=versions)
[](https://bundlephobia.com/package/winston-datadog-browser)
[](https://raw.githubusercontent.com/manbearwiz/winston-datadog-browser/master/LICENSE)
[](https://www.npmjs.com/package/winston-datadog-browser)
[](https://github.com/manbearwiz/winston-datadog-browser/issues)
[](https://github.com/semantic-release/semantic-release)
Send winston logs from the browser to Datadog via the [datadog browser logs SDK](https://github.com/DataDog/browser-sdk/tree/main/packages/logs#browser-log-collection).
`winston-transport` + `@datadog/browser-logs`
## Installation
```sh
npm install --save winston winston-datadog-browser
```
## Usage
```ts
import { configure, format } from 'winston';
import { DatadogBrowserLogs } from 'winston-datadog-browser';
configure({
transports: [
new DatadogBrowserLogs({
clientToken: '',
site: '',
forwardErrorsToLogs: true,
sampleRate: 100,
}),
// Optionally, also log to browser console
new BrowserConsole({
format: format.simple(),
}),
],
});
```
## Configuration
`DatadogBrowserLogs` uses the same configuration interface as `@datadog/browser-logs`. See the [datadog initialization parameters](https://github.com/DataDog/browser-sdk/tree/main/packages/logs#initialization-parameters) for more details.