package
A stream that sends Pino log events to Seq
npm install pino-seqGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 8 packages.
699.1 kB
Includes dependencies.
A stream to send Pino events to Seq. Tested with Node.js versions 18.x and up.
Now written in TypeScript with automatic type definitions and full ES Module support!
npm install pino-seqUse the createStream() method to create a Pino stream configuration, passing serverUrl, apiKey and batching parameters.
This example works in both JavaScript and TypeScript projects:
import pino from 'pino';
import { createStream } from 'pino-seq';
// Create a stream to Seq
const stream = createStream({
serverUrl: 'http://localhost:5341',
apiKey: 'your-api-key' // optional
});
// Create a Pino logger
const logger = pino({ name: 'pino-seq example' }, stream);
// Log some messages
logger.info('Hello Seq, from Pino');
// Child loggers work too
const frLogger = logger.child({ lang: 'fr' });
frLogger.warn('au reviour'
For TypeScript projects with explicit typing:
import { createStream, PinoSeqStreamConfig } from 'pino-seq';
const config: PinoSeqStreamConfig = {
serverUrl: 'http://localhost:5341',
// ... see Configuration section below for all options
};
const stream = createStream(config);The createStream() function accepts a configuration object with the following properties:
serverUrl (string): The URL of your Seq serverapiKey (string, optional): API key for authenticationlogOtherAs (string, optional): Log level for unstructured messages ('Verbose', 'Debug', 'Information', 'Warning', 'Error', 'Fatal')additionalProperties (object, optional): Additional properties to add to all log eventsmaxBatchingTime (number, optional): Maximum time in milliseconds to wait before sending a batcheventSizeLimit (number, optional): Maximum size of a single eventbatchSizeLimit (number, optional): Maximum size of a batchonError (function, optional): Error handler callbackOriginally by Simi Hartstein and published as simihartstein/pino-seq; maintainership transferred to Datalust at version 0.5.
simihartstein
simihartstein@gmail.com