@icco/pino-stackdriver-serializers
v2020.4.4-1
Published
A set of serializers that stackdriver understands
Downloads
1
Readme
@icco/pino-stackdriver-serializers
Pino messaging formatting for Stackdriver.
Usage
lib/logger.js
const pinoLogger = require("pino");
const pinoStackdriver = require("@icco/pino-stackdriver-serializers");
module.exports = {
logger: pinoLogger({
messageKey: "message",
level: "info",
formatters: pinoStackdriver.sdFormatter(),
}),
};
server.js
import express from "express";
import pinoMiddleware from "pino-http";
import { logger } from "./lib/logger.js";
const server = express();
server.use(pinoMiddleware({logger}));