1.0.18 • Published 2 years ago

@c2m/c2m-logger-add-elk v1.0.18

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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",
});
1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago