@alliedpayment/logger

3.0.2 • Public • Published

Allied Logger

winston logger with conventions for sending to allied's graylog servers via winston gelf udp transport

Usage

process.env.GRAYLOG_USE = "true"; // opt in to use the graylog transport otherwise only console is used

process.env.GRAYLOG_HOST = "udplog.host.name";
process.env.GRAYLOG_PORT = 12201;
process.env.GRAYLOG_SOURCE = "allied-logger-test-source";
process.env.GRAYLOG_SOURCE_CONTEXT = "allied-logger-test-source-context";
process.env.ALLIED_ENV = "test";

const log = require("./logger");

log.debug("debug message", { prop: "123" }); // logged with level "debug" (7) and additional properties
log.info("info message", { prop: "123" }); // logged with level "info" (6) and additional properties
log.warn("warn message", { prop: "123" }); // logged with level "warn" (4) and additional properties
log.error("error message", { prop: "123" }); // logged with level "error" (3) and additional properties

log.info("info message", {
  prop: "123",
  complex: { nested: { deeper: "value", sibling: 1 }, array: [1, 2, 3] },
}); // logged with level "info" (6) and additional properties

Readme

Keywords

none

Package Sidebar

Install

npm i @alliedpayment/logger

Weekly Downloads

6

Version

3.0.2

License

MIT

Unpacked Size

2.86 kB

Total Files

3

Last publish

Collaborators

  • jerry.wickey
  • harikakunda
  • ktodoran
  • weispm01