0.0.0 • Published 4 years ago

hapi-pino-good v0.0.0

Weekly downloads
1
License
UNLICENSED
Repository
github
Last release
4 years ago

hapi-pino-good

The functionality good using pino

npm version

Install

npm install --save hapi-pino-good

Usage

import { goodPino, IGoodPinoOptions } from '@tepez/hapi-pino-good'
import { Server } from 'hapi';


export async function initServer(server: Server): Promise<void> {
    await server.register<IGoodPinoOptions>({
        plugin: goodPino,
        options: {
            instance: logger,
            includes: {
                request: {
                    payload: true,
                    headers: true,
                },
            },
            log: {
                request: false,
            },
        },
    });
}

Customizing the default logger instance

Before registering the goodPino plugin, do:

import { resetLogger } from '@tepez/hapi-pino-good'

resetLogger({
    logStdout: false,
    logFile: '/path/to/hapi.log'
});