MCPcopy Index your code
hub / github.com/datalust/seq-logging

github.com/datalust/seq-logging @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
35 symbols 72 edges 16 files 4 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

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.

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.

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

Extension points exported contracts — how you extend this code

SeqLoggerConfig (Interface)
(no doc)
index.d.ts
RemoteConfig (Interface)
(no doc)
index.d.ts
SeqEvent (Interface)
(no doc)
index.d.ts

Core symbols most depended-on inside this repo

emit
called by 13
seq_logger.js
close
called by 9
seq_logger.js
flush
called by 6
seq_logger.js
makeTestEvent
called by 6
test/seq_logger_tests.js
_clearTimer
called by 5
seq_logger.js
isValue
called by 3
seq_logger.js
_setTimer
called by 2
seq_logger.js
_reset
called by 2
seq_logger.js

Shape

Method 18
Function 8
Class 6
Interface 3

Languages

TypeScript100%

Modules by API surface

seq_logger.js22 symbols
index.d.ts5 symbols
test/seq_logger_tests.js4 symbols
example/example_async.js1 symbols
example/example.js1 symbols
example/browser/src/status.js1 symbols
example/browser/cypress.config.js1 symbols

For agents

$ claude mcp add seq-logging \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page