@ist-group/dynamic-bunyan-seq
TypeScript icon, indicating that this package has built-in type declarations

3.2.0 • Public • Published

Dynamic bunyan seq

The purpose of this module is to control the seq log level dynamically from the seq server interface.

Install

yarn add @ist-group/dynamic-bunyan-seq

Usage

import { createAttachDynamicSeq } from "@ist-group/dynamic-bunyan-seq";

const logger = bunyan.createLogger({
  name: "Logger-name",
  src: true
});

const { update, seqStream, flush } = createAttachDynamicSeq({
  bunyanLogger: logger,
  seqHost: config.SEQ_HOST,
  seqApiKey: config.SEQ_API_KEY
});
update: poll new log level
flush: flush the buffer, useful when the service is about to die
seqStream: the object that is given from require("bunyan-seq").createStream()
Param required Default Description
bunyanLogger yes - The Bunyan logger object
seqHost yes - ex: https://seq.example.com
seqApiKey no - Seq api key
requestTimeout no 30 000 request timeout in ms

Additional: Formated output

Also included is a tool to display console output with included properties (the seq way)

Usage

Pipe output from node into bunyan-seq-format:

node build/server.js | ./node_modules/.bin/bunyan-seq-format -o short

Example of log:

logger.info(
  { status: 200, statusMessage: "Ok" },
  "Request finished with status: {status} and message: {statusMessage}"
);

Dependencies (4)

Dev Dependencies (4)

Package Sidebar

Install

npm i @ist-group/dynamic-bunyan-seq

Weekly Downloads

13

Version

3.2.0

License

MIT

Unpacked Size

67.3 kB

Total Files

11

Last publish

Collaborators

  • omer.irfan
  • rhine
  • gabts