1.0.1 • Published 6 months ago

opensearch-logger v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

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));
1.0.1

6 months ago

1.0.0

6 months ago