@c2m/c2m-logger-add-elk
TypeScript icon, indicating that this package has built-in type declarations

1.0.18 • Public • Published

Winston logger with transport for ELK

in order to send logs to ELK, you need to configure the logger with the following ElkLoggerOptions:

import { ElkLoggerOptions } from "@c2m/c2m-logger-add-elk";

ElkLoggerOptions should get the following properties:

  • ELK_HOST - the host of the ELK server
  • ELK_USER - the user of the ELK server
  • ELK_PASS - the password of the ELK server
  • LOG_LEVEL(optional) - the log level of the logger. default is warn

Usage

import { ElkLoggerOptions, logger } from "@c2m/c2m-logger-add-elk";

const elkOptions: ElkLoggerOptions = {
  ELK_HOST: process.env.ELK_HOST,
  ELK_USER: process.env.ELK_USER,
  ELK_PASS: process.env.ELK_PASS,
};

logger.setELKConfig(elkOptions);

logger.elk("some data to log", "warn", {
  cartId: "some Cart Id",
  branch: "some branch",
  chain: "some chain",
  processName: "some process name",
  statusCode: "some status code",
});

Readme

Keywords

none

Package Sidebar

Install

npm i @c2m/c2m-logger-add-elk

Weekly Downloads

1

Version

1.0.18

License

ISC

Unpacked Size

55.5 kB

Total Files

18

Last publish

Collaborators

  • oren-c2m
  • c2m2