@c2m/c2m-logger-add-elk
v1.0.18
Published
in order to send logs to ELK, you need to configure the logger with the following `ElkLoggerOptions`:
Downloads
5
Readme
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 serverELK_USER
- the user of the ELK serverELK_PASS
- the password of the ELK serverLOG_LEVEL
(optional) - the log level of the logger. default iswarn
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",
});