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

log extension within the loopback/extensions #4089

Closed
fidgi opened this issue Nov 9, 2019 · 11 comments
Closed

log extension within the loopback/extensions #4089

fidgi opened this issue Nov 9, 2019 · 11 comments
Assignees
Labels

Comments

@fidgi
Copy link

fidgi commented Nov 9, 2019

Suggestion

It would be great to have a log extension (something similar to the log-extension example within the supported loopback extensions

Use Cases

Just to be able manage log level indevelopment and production mode

Examples

see log-extension example

Acceptance criteria

TBD - will be filled by the team.

@fidgi fidgi added the feature label Nov 9, 2019
@marioestradarosa
Copy link
Contributor

@fidgi , you mean something like this ?

#3975 (comment)

@fidgi
Copy link
Author

fidgi commented Nov 10, 2019

@marioestradarosa What I'm looking for is a mixin to ease the integration of a logging framework such as winston and an option in loopback/cli to enable this mixin at app creation time .

@marioestradarosa
Copy link
Contributor

@fidgi correct!, I just wanted to make sure that's final log functionality you were looking for. Indeed that could be a good feature "external extension/package" to leverage the extensibility of looback 4 framework. I will try to write an external extension similar to the example I provided for winston.

@fidgi
Copy link
Author

fidgi commented Nov 13, 2019

@raymondfeng thank for working on this

@bajtos
Copy link
Member

bajtos commented Nov 15, 2019

Cross-posted from #4117 (comment)

I'd like to start the discussion with building a better understanding of different loggers and log collectors that we can choose from.

@raymondfeng Why did you pick winston and fluentd in particular?

Personally, I prefer to use pino for logging, it's more modern than winston/bunyan and is significantly more performant (2x faster according to pino's benchmarks).

I am not familiar with log collectors. I see that fluentd is a part of Cloud Native Computing Foundation, I guess that makes it a good candidate.

@strongloop/loopback-next thoughts?

@fidgi
Copy link
Author

fidgi commented Nov 15, 2019

I'm fine with any logging framework that is extensible and that provide a way to hide sensible data in the logs depending of the log level. For what I know winston is ok.
fluentd is also a good choice for us as we planned to use it to collect logs from our loopback-based microservices running in Kubernetes.

@raymondfeng
Copy link
Contributor

For the record, Pino seems to focus more on efficiency but its extensibility has room for improvement, for example, formatter to transform logs and transports to collect logs to physical destinations.

@marioestradarosa
Copy link
Contributor

@raymondfeng , we have been using winston as a logger in production with no problems so far. Indeed we chose it because of its formatter capabilities.

@raymondfeng
Copy link
Contributor

Please check out https://github.com/strongloop/loopback-next/blob/logging/extensions/logging/README.md. Feedback is welcome!

@fidgi
Copy link
Author

fidgi commented Nov 20, 2019

@raymondfeng Thanks for this great work. .

@dhmlau
Copy link
Member

dhmlau commented Dec 16, 2019

Closing as done. Thanks.

@dhmlau dhmlau closed this as completed Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants