3.2.0 • Published 3 years ago

@ist-group/dynamic-bunyan-seq v3.2.0

Weekly downloads
10
License
MIT
Repository
-
Last release
3 years ago

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()
ParamrequiredDefaultDescription
bunyanLoggeryes-The Bunyan logger object
seqHostyes-ex: https://seq.example.com
seqApiKeyno-Seq api key
requestTimeoutno30 000request 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}"
);
3.2.0

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.0

3 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago