microservices-demo
microservices-demo copied to clipboard
Use Single `log` Object in `frontend` Service
Describe request or inquiry
- This was inspired by a thread in pull-request 699.
- Let's create a
log = logrus.New()
object in a new/separatelogger.go
file. - This
log
object will be reused across thefrontend
service.
What purpose/environment will this feature serve?
- This is just a clean-up.
- It's good practice to keep all logging-related configuration of a service in one place so that developers can easily configure logging.
- This is a low priority clean-up.
I think we should still do this. Commenting to reset SLO.
HI i want to contribute to this issue please assign me this issue
Hi @aarushisoni, Thank you so much for your interest. I've gone ahead and assigned this GitHub Issue to you.
Hi is this issue still open? I would like to work on this issue, please assign me in this.
Can you please direct me to the file where changes are to be made.?
@NimJay, I have raised the PR (#1390 ). Please review it and let me know for any changes.
Thank you, @mahi072! I will leave my review at https://github.com/GoogleCloudPlatform/microservices-demo/pull/1390. :)
If we decide on refactoring the logging implementation in the frontend, we should consider using the structured logging and leverage Kubernetes logging (and 12factor/logs) by logging to console. With the new tracing capabilities (using OTel) we do not need to capture request info in middleware explicitly. there are few other things that can be done.
Use a single log object across all modules should be justified and is not necessary the best practice.
I've responded via https://github.com/GoogleCloudPlatform/microservices-demo/pull/1390#issuecomment-1375987313. tl;dr - Let's close this issue if we don't hear back from the author of https://github.com/GoogleCloudPlatform/microservices-demo/pull/1390.