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

feat: init logging middleware on server mode #287

Merged

Conversation

matthisholleville
Copy link
Contributor

Closes #

πŸ“‘ Description

This code adds middleware logging functionality to a server, allowing it to log every request executed. The logger used in this implementation is the zap logging library.

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

β„Ή Additional Information

Log format :

{"level":"error","ts":1681677987.851809,"msg":"unsupported output format: fake. Available format json,text\n","duration_ms":1255,"method":"GET","remote_addr":"127.0.0.1:63095","status_code":500,"url":"/analyze","stacktrace":"xxxxxx"}
{"level":"info","ts":1681678081.765677,"msg":"request completed","duration_ms":1100,"method":"GET","remote_addr":"127.0.0.1:63100","status_code":200,"url":"/analyze"}

Signed-off-by: Matthis Holleville <matthish29@gmail.com>
@matthisholleville matthisholleville requested review from a team as code owners April 16, 2023 21:50
@matthisholleville matthisholleville merged commit 3c4bc1a into k8sgpt-ai:main Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants