2.2.0 • Published 1 month ago

seq-logging v2.2.0

Weekly downloads
19,431
License
Apache-2.0
Repository
github
Last release
1 month ago

Seq Logging for JavaScript Build Publish NPM

This library makes it easy to support Seq from Node.js logging libraries, including Winston via winston-seq, Pino via pino-seq, Bunyan via bunyan-seq, and Ts.ED logger via @tsed/logger-seq. It is not expected that applications will interact directly with this package.

Requiring for Node

const seq = require('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.

const seq = require('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.

const process = require('process');
const seq = require('seq-logging');

const logger = new seq.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

2.2.0

1 month ago

2.1.1

10 months ago

2.1.0

10 months ago

2.0.0

12 months ago

1.1.2

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.5.0

3 years ago

0.4.5

4 years ago

0.4.6

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

6 years ago

0.2.0

7 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.1

8 years ago