Skip to content

Unable to log a "request" event while using "response.failaction" settings as "log" instead of throwing an error. #80

@fvalmeida

Description

@fvalmeida

Hapi allows you to choose what to do when response validation fails by setting response.failAction. (ref.: https://hapijs.com/tutorials/validation#failaction)

When we set that option to:

image

the current way that hapi-pino is set to log requests which have the event.channel set to internal doesn't recognizes that configuration and the log message is ignored.

This is where Hapi check for the response.failAction settings
node_modules/@hapi/hapi/lib/toolkit.js
image

This is where Hapi creates a log payload using the internal channel
node_modules/@hapi/hapi/lib/request.js
image

This is where hapi-pino is ignoring the log message:
node_modules/hapi-pino/index.js
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions