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

日志Fields字段需要重制 #810

Open
wangle201210 opened this issue Aug 23, 2024 · 1 comment
Open

日志Fields字段需要重制 #810

wangle201210 opened this issue Aug 23, 2024 · 1 comment
Labels

Comments

@wangle201210
Copy link

Reproduction link

https://github.com/go-admin-team/go-admin

Steps to reproduce

  1. 正常访问一个项目api接口
  2. 访问一个含有直接使用 log.Infof("data: %v", data) 的接口,或者运行jobs,jobs里面直接使用log.Info(Error等都可以)
  3. 此时打印出来的日志会包含第一步的api接口信息,比如第1步的路由地址、traceID 等

What is expected?

第2步打印出来的日志只需要自己的信息,不要混杂第1步的信息

What is actually happening?

第2步打印出来的日志混杂了第1步的信息

Environment Info
go-admin latest
Go 1.21.0
System Darwin arm64
Browser chrome

案列

  • 第1步的日志:2024-08-23 16:33:19.267 0800 127.0.0.1 1.840549625s info GET 200 /api/v1/account e45ba58d-f4e1-48aa-83f2-14a90461e904
  • 第2步的日志:2024-08-23 16:35:00.108 0800 127.0.0.1 jobs/jobbase.go:57 1.840549625s error GET 200 /api/v1/account e45ba58d-f4e1-48aa-83f2-14a90461e904 redislock: not obtained
    明显第2步的日志里面混入了第1步的接口信息
@wangle201210
Copy link
Author

4404e206b0d44d0983ad3fcc8553ba07 bb2caf02813bf4e6eb98ee560295218b

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

1 participant