opensearch-logger
v1.0.1
Published
Opensearch logger
Downloads
197
Readme
Opensearch Logger
Description
This project is a simple Opensearch logger for javascript-based projects.
Legal
This software is distributed free of cost and does not provide support or warranty to the end user or developer.
Installation
npm i opensearch-logger
Usage
import Logger from "opensearch-logger";
const logger = new Logger(
{
node: "https://your-opensearch-domain.amazonaws.com",
auth: { username: "user", password: "pass" },
},
"my-application",
"source-of-data",
);
const jsonData = {}; //structure your debug data;
logger.debug("Debug", JSON.stringify(jsonData));
logger.info("Another app started");
logger.error("Error has occured", {
error: "error details",
errorCode: 123456,
});
logger.warn("Warning", JSON.stringify(jsonData));