Skip to content

Commit

Permalink
Update hapi-pino usage examples (#1580)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansamines committed Oct 25, 2022
1 parent f024788 commit 24f10f3
Showing 1 changed file with 4 additions and 8 deletions.
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

0 comments on commit 24f10f3

Please sign in to comment.