All Projects → alexandrebodin → hapi-good-winston

alexandrebodin / hapi-good-winston

Licence: MIT license
A good reporter to send and log events with winston

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to hapi-good-winston

good-sentry
Sentry broadcasting for good process monitor
Stars: ✭ 15 (-28.57%)
Mutual labels:  good, hapi, hapijs, hapi-good
hapi-now-auth
Hapi token auth for bearer and jwt
Stars: ✭ 43 (+104.76%)
Mutual labels:  hapi, hapijs, hapi-plugin
hapi-plugin-mysql
Hapi plugin for MySQL
Stars: ✭ 17 (-19.05%)
Mutual labels:  hapi, hapijs, hapi-plugin
hapi-moon
Hassle-free and production ready hapi.js Server boilerplate
Stars: ✭ 23 (+9.52%)
Mutual labels:  hapi, hapijs
hapi-mongo-models
📦 A hapi plugin for `mongo-models`
Stars: ✭ 101 (+380.95%)
Mutual labels:  hapi, hapi-plugin
hapi-cli
CLI to build API with Hapi, mongodb and mongoose. Work with Hapi V17.
Stars: ✭ 36 (+71.43%)
Mutual labels:  hapi, hapijs
nestlogger
Logger library for NestJs services
Stars: ✭ 28 (+33.33%)
Mutual labels:  logger, winston
hapi-sequelizejs
A hapi.js plugin to connect with Sequelize ORM
Stars: ✭ 56 (+166.67%)
Mutual labels:  hapi, hapi-plugin
hapi-sentry
A hapi plugin for request error logging to Sentry
Stars: ✭ 24 (+14.29%)
Mutual labels:  hapi, hapi-plugin
hapi-dev-errors
A hapi plugin to return better error details and skip the look at command line to catch the issue.
Stars: ✭ 58 (+176.19%)
Mutual labels:  hapi, hapi-plugin
hapi-routes
Hapi plugin for registering routes
Stars: ✭ 12 (-42.86%)
Mutual labels:  hapijs, hapi-plugin
sapper-authentication-demo
A demonstration of Auth with Sapper + JWT + Server Side Rendering + RBAC
Stars: ✭ 102 (+385.71%)
Mutual labels:  hapi, hapijs
hapi-statsd
A hapi plugin for sending request round trip metrics to statsd
Stars: ✭ 29 (+38.1%)
Mutual labels:  hapi, hapi-plugin
typesafe-hapi
Typechecking for HapiJS based on Joi schemas!
Stars: ✭ 21 (+0%)
Mutual labels:  hapi, hapijs
koa2-winston
koa2 version winston logger like express-winston
Stars: ✭ 37 (+76.19%)
Mutual labels:  logger, winston
Crashlyzer
Crash viewer web application for displaying the crashes reported by rn-crash-reporter components from React Native mobile applications.
Stars: ✭ 59 (+180.95%)
Mutual labels:  hapi, hapijs
rest-api-node-typescript
This is a simple REST API with node and express with typescript
Stars: ✭ 154 (+633.33%)
Mutual labels:  logger, winston
hapi-docs
Beautiful API documentation generator for Hapi using Vue
Stars: ✭ 64 (+204.76%)
Mutual labels:  hapi, hapi-plugin
nodejs-tutorials-hapi
Examples for the hapi tutorial series within the Future Studio University
Stars: ✭ 70 (+233.33%)
Mutual labels:  hapi, hapijs
winston-dev-console
Winston@3 console format aimed to improve development UX
Stars: ✭ 88 (+319.05%)
Mutual labels:  logger, winston

hapi-good-winston

A good reporter to send and log events with winston

npm npm license

CircleCI Dependency Status

Issues PR

Disclaimer

  • Use v3.* for hapi >= 18

  • Use v2.* for version prior to hapi v18

  • Use v1.* for version prior to hapi v17

Installation

$ npm install --save hapi-good-winston

Usage

import { Server } from 'hapi';
import winston from 'winston';
import goodWinston from 'hapi-good-winston';

const logger = winston.createLogger({
    level: 'info',
    format: winston.format.json(),
    transports: [new winston.transports.Console()],
});

const server = new Server();

// Set winston minimum log level to debug
// winston.level = 'debug';

// Only the 'response' and 'error' event levels will be overwritten
const goodWinstonOptions = {
    levels: {
        response: 'debug',
        error: 'info',
    },
};

const options = {
    ops: {
        interval: 1000,
    },
    reporters: {
        // Simple and straight forward usage
        winston: [goodWinston(logger)],
        // Adding some customization configuration
        winstonWithLogLevels: [goodWinston(logger, goodWinstonOptions)],
        // This example simply illustrates auto loading and instantiation made by good
        winston2: [
            {
                module: 'hapi-good-winston',
                name: 'goodWinston',
                args: [logger, goodWinstonOptions],
            },
        ],
    },
};

server
    .register({
        plugin: require('good'),
        options,
    })
    .then(() => {
        return server.start();
    })
    .then(() => {
        console.info(`Server started at ${server.info.uri}`);
    });

Links

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].