Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

A bite-sized bunyan logger with color and a built-in stackdriver stream.

Notifications You must be signed in to change notification settings

the-control-group/snackdriver

Repository files navigation

snackdriver

A bite-sized bunyan logger with color, express middleware and a built-in stackdriver stream.

install:

npm install --save snackdriver

example:

const Logger = require("snackdriver");
const log = new Logger({
	logName: "test",
	logStreams: [
		{ env: "development", stream: "bunyanDebugStream" },
		{ env: "development", stream: "stdout" },
		{ env: "production", stream: "stackdriver" }
	],
	logLevel: "info"
});

log.info("hello world");
log.warn("oh no world");
log.error("ruh roh world");

Koa request logging middleware

app.use(log.koaMiddleWare());

express request logging middleware

app.use(log.expressMiddleWare());

console output:
alt text

And if your NODE_ENV is set to production it logs to stack driver.

stackdriver output:
alt text

About

A bite-sized bunyan logger with color and a built-in stackdriver stream.

Resources

Security policy

Stars

Watchers

Forks

Packages

No packages published