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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to customize the log format? #110

Open
iwilsonlee opened this issue Jun 9, 2020 · 2 comments
Open

How to customize the log format? #110

iwilsonlee opened this issue Jun 9, 2020 · 2 comments

Comments

@iwilsonlee
Copy link

Hi guys,
How to customize the log format in this plugin? Now the log time format is the timestamp, and I want to convert it to the customize formatter, who can tell me how to do this?
thanks for the help.

@kungfutse
Copy link
Contributor

kungfutse commented Oct 7, 2020

I haven't tried, but looking at the documentation, you might be able to do it using custom pino instance as I don't think you can set these options through the plugin registration: see https://github.com/pinojs/pino/blob/HEAD/docs/api.md#opt-timestamp and https://github.com/pinojs/pino/blob/HEAD/docs/api.md#pinostdtimefunctions-object

@VirgileD
Copy link

Yes, in fact you can, just put the pino option you need in the hapi-pino options. Hapi-pino options are given to pino as options there: https://github.com/pinojs/hapi-pino/blob/44cbdec76cb29df2d8e90a4efd35a206b7b02133/index.js#L51

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants