{"library":"seq-logging","title":"Seq Logging for JavaScript","description":"seq-logging is a JavaScript library designed to send structured log events to the Seq HTTP ingestion API. It is currently at version 3.0.0 and serves as a low-level client, primarily intended for use by other logging frameworks and their respective Seq transports (e.g., winston-seq, pino-seq, bunyan-seq, @tsed/logger-seq), rather than for direct application interaction. The library handles asynchronous batching of log events based on payload size and provides mechanisms to ensure all buffered events are sent upon application exit or explicit flushing. Its key differentiator is acting as the foundational communication layer for Seq within the JavaScript ecosystem, offering both Node.js and browser-specific builds, and explicitly supports ESM.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install seq-logging"],"cli":null},"imports":["import { Logger } from 'seq-logging'","import { Logger } from 'seq-logging/browser'","import type { LoggerOptions } from 'seq-logging'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import process from 'process';\nimport { Logger } from 'seq-logging';\n\nconst logger = new Logger({\n    serverUrl: process.env.SEQ_SERVER_URL ?? 'http://localhost:5341',\n    apiKey: process.env.SEQ_API_KEY ?? undefined, // Optional\n    requestTimeout: 30000 // default to 30s\n});\n\nlogger.emit({\n    timestamp: new Date(),\n    level: 'Information',\n    messageTemplate: 'Hello from {appName}! It is {currentTime}.',\n    properties: {\n        appName: 'MySeqApp',\n        currentTime: new Date().toISOString(),\n        user: process.env.USERNAME ?? 'anonymous'\n    }\n});\n\n// Ensure all buffered events are sent before exiting\nlogger.close().then(() => console.log('Logger closed successfully.'));","lang":"typescript","description":"Initializes a Seq Logger and emits a structured log event with properties, demonstrating basic usage and proper shutdown.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}