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

Suggestion for go-zero Logging Functionality #4569

Open
zhaozuowu opened this issue Jan 14, 2025 · 0 comments
Open

Suggestion for go-zero Logging Functionality #4569

zhaozuowu opened this issue Jan 14, 2025 · 0 comments

Comments

@zhaozuowu
Copy link

Description:
During my usage of go-zero, I noticed that the logging of input and output parameters is primarily recorded in a single content field using path and method. This approach can be limiting, especially when troubleshooting issues in production.

Problem:
1:Current logging methods record path, method, code, request, and response to the content string text, not to a json structure, which allows you to use tools like ELK, according to path, method, code, and code. The input or output becomes very difficult to retrieve, as shown in Figure 1
image

2:In complex API debugging and issue resolution, having a JSON structure would significantly enhance the ability to perform field-based full-text searches, improving troubleshooting efficiency.

Suggestion:
I would like to suggest enhancing the go-zero logging feature to support recording input and output, as well as method, path, code parameters as JSON structures. This will allow developers to more efficiently analyze logs and troubleshoot problems, similar to Figure 2, which is the result of our revamp of the go-zero log
image

Thank you for your hard work and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant