@alliedpayment/logger
v3.0.2
Published
winston logger with conventions for sending to allied's graylog servers via winston gelf udp transport
Downloads
37
Keywords
Readme
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