microservices-demo icon indicating copy to clipboard operation
microservices-demo copied to clipboard

Use Single `log` Object in `frontend` Service

Open NimJay opened this issue 3 years ago • 1 comments

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/separate logger.go file.
  • This log object will be reused across the frontend 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.

NimJay avatar Feb 01 '22 19:02 NimJay

I think we should still do this. Commenting to reset SLO.

bourgeoisor avatar Aug 22 '22 15:08 bourgeoisor

HI i want to contribute to this issue please assign me this issue

aarushisoni avatar Dec 07 '22 11:12 aarushisoni

Hi @aarushisoni, Thank you so much for your interest. I've gone ahead and assigned this GitHub Issue to you.

NimJay avatar Dec 07 '22 16:12 NimJay

Hi is this issue still open? I would like to work on this issue, please assign me in this.

mahi072 avatar Dec 08 '22 08:12 mahi072

Can you please direct me to the file where changes are to be made.?

mahi072 avatar Dec 12 '22 16:12 mahi072

@NimJay, I have raised the PR (#1390 ). Please review it and let me know for any changes.

mahi072 avatar Dec 12 '22 17:12 mahi072

Thank you, @mahi072! I will leave my review at https://github.com/GoogleCloudPlatform/microservices-demo/pull/1390. :)

NimJay avatar Dec 12 '22 17:12 NimJay

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.

minherz avatar Dec 14 '22 22:12 minherz

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.

NimJay avatar Jan 09 '23 17:01 NimJay