# seq-logging

> Sends structured log events to the Seq HTTP ingestion API

Latest version **3.2.0** (published 2026-08-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install seq-logging
pnpm add seq-logging
yarn add seq-logging
bun add seq-logging
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2026-08-28 |
| First published | 2016-03-25 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.18 |
| Dependencies | 2 |
| Unpacked size | 44.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 33 |
| Author | Datalust and contributors |
| Maintainers | nblumhardt, seq, kodraus, liam.mclennan-datalust |
| Keywords | seq, logging |

## Links

- npm: https://www.npmjs.com/package/seq-logging
- Repository: https://github.com/datalust/seq-logging
- Issues: https://github.com/datalust/seq-logging/issues
- npm.io page: https://npm.io/package/seq-logging

## Dependencies (2)

- [node-fetch](https://npm.io/package/node-fetch.md) ^2.7.0
- [abort-controller](https://npm.io/package/abort-controller.md) ^3.0.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

- 3.2.0 (latest) — 2026-08-28
- 3.0.0 — 2025-05-06
- 2.2.0 — 2024-03-20
- 2.1.1 — 2023-07-07
- 2.1.0 — 2023-07-06
- 2.0.0 — 2023-05-02
- 1.1.2 — 2022-09-07
- 1.1.1 — 2021-08-20
- 1.1.0 — 2021-07-22
- 1.0.0 — 2021-06-09
- 0.5.0 — 2020-12-07
- 0.4.6 — 2020-06-11
- 0.4.5 — 2020-06-11
- 0.4.3 — 2020-02-25
- 0.4.2 — 2020-02-25
- … 12 more at https://npm.io/package/seq-logging/versions

## README

# Seq Logging for JavaScript ![Build](https://github.com/datalust/seq-logging/workflows/Test/badge.svg) ![Publish](https://github.com/datalust/seq-logging/workflows/Publish/badge.svg) [![NPM](https://img.shields.io/npm/v/seq-logging.svg)](https://www.npmjs.com/package/seq-logging)

> This library makes it easy to support Seq from Node.js logging libraries, including [Winston](https://github.com/winstonjs/winston) via [winston-seq](https://github.com/datalust/winston-seq), [Pino](https://github.com/pinojs/pino) via [`pino-seq`](https://github.com/datalust/pino-seq), [Bunyan](https://github.com/trentm/node-bunyan) via [`bunyan-seq`](https://github.com/continuousit/bunyan-seq), and [Ts.ED logger](https://logger.tsed.io) via [@tsed/logger-seq](https://logger.tsed.io/appenders/seq.html). It is not expected that applications will interact directly with this package.

### Requiring for Node

```js
import { Logger } from 'seq-logging';
```

### Requiring for a browser

Using `seq-logging` in a browser context is the same, except the module to import is `seq-logging/browser`.

```js
import { Logger } from 'seq-logging/browser';
```

### Usage

A `Logger` is configured with `serverUrl`, and optionally `apiKey` as well as event and batch size limits.
`requestTimeout` can be used to adjust timeout for stalled connections, default: 30s.

```js
import process from 'process';
import { Logger } from 'seq-logging';

const logger = new Logger({ serverUrl: 'http://localhost:5341' });

logger.emit({
    timestamp: new Date(),
    level: 'Information',
    messageTemplate: 'Hello for the {n}th time, {user}!',
    properties: {
        user: process.env.USERNAME,
        n: 20
    }
});

logger.close();
```

Events are sent using the `emit()` method, that internally performs asynchronous batching based on payload size.

When the application exits, `close()` ensures all buffered events are written. This can be done at any time otherwise using the `flush()` method. Both of these methods return promises indicating completion.

### Implementations

 * [bunyan-seq](https://github.com/datalust/bunyan-seq) - collect events from the Buyan logging framework
 * [pino-seq](https://github.com/datalust/pino-seq) - A stream to send Pino events to Seq
 * [winston-seq](https://github.com/datalust/winston-seq) - A Seq transport for Winston
 * [@tsed/logger-seq](https://logger.tsed.io/appenders/seq.html) - A Seq transport for Ts.ED logger

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