-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Recommended setup for production #1491
Comments
The default settings are defined to work well in your simple production setup. You don't need to tweak anything. All the above are required if you have more sophisticated requirements. Would you like to send a PR to clarify this further in our docs? |
By default settings you mean this, right?const logger = pino(); According to the documentation, the default const logger = pino(pino.destination(1)); As far as I understand, const transport = pino.transport({
target: "pino/file",
});
const logger = pino(transport); Benchmark - based on the
|
No. This just adds more overhead due to moving the data off the main thread. However this is available for people that want to log to multiple destinations, e.g. to elastic search and to a file. In that case the file transport is useful.
No.
Indeed! But curiosity is great! |
I was looking for this exact bit of information. From reading the documentation, it was not clear that the default mode ( Having said all that...
I tried to think about how to fit this into the docs as they stand, and was not able to come up with a good solution. Maybe, simply, an entry to help? |
My attempt to capture @mcollina's reply: pinojs#1491 (comment) in some doc form
* docs: add 'best performance for basic stdout logging' to help.md My attempt to capture @mcollina's reply: #1491 (comment) in some doc form * change help section * Update docs/help.md Co-authored-by: Matteo Collina <matteo.collina@gmail.com> * Update docs/help.md Co-authored-by: Matteo Collina <matteo.collina@gmail.com> --------- Co-authored-by: Matteo Collina <matteo.collina@gmail.com>
The documentation contains a mixed use of
pino.transport
,pino.destination
,pino.multistream
, and Pino created without arguments. Legacy vs Pino v7+ transports is also confusing.What's the recommended setup for production? Production = least overhead, best performance, logging to stdout
My first guess would be
After reading the documentation, I've found a paragraph:
This makes
pino.destination
a wrong choice because it runs in the main thread. Therefore to get the best performance out of Pino we must use v7+ transports.In our case we want to log to stdout, therefore we create a
pino/file
transport:Having a section in the documentation about running Pino in production would be great. Unfortunately, there are too many options at the moment, which can confuse new users of Pino (or even existing users like myself).
The text was updated successfully, but these errors were encountered: