Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hapi-pino usage example #1580

Merged
merged 1 commit into from Oct 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 4 additions & 8 deletions docs/web.md
Expand Up @@ -70,7 +70,8 @@ npm install hapi-pino

require('make-promises-safe')

const Hapi = require('hapi')
const Hapi = require('@hapi/hapi')
const Pino = require('hapi-pino');

async function start () {
// Create a server with a host and port
Expand All @@ -94,15 +95,10 @@ async function start () {
}
})

await server.register({
plugin: require('.'),
options: {
prettyPrint: process.env.NODE_ENV !== 'production'
}
})
await server.register(Pino)

// also as a decorated API
server.logger().info('another way for accessing it')
server.logger.info('another way for accessing it')

// and through Hapi standard logging system
server.log(['subsystem'], 'third way for accessing it')
Expand Down