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

如何修改日志格式,增加从 header 中获取的信息 #419

Open
keanu-jinu opened this issue Oct 1, 2024 · 1 comment
Open

Comments

@keanu-jinu
Copy link

需求:
header 中存在请求 id,比如 qid 参数
要求所有该请求产生的日志中都能存在 qid 信息。

@imzhaosir
Copy link

可以参考vendor/workerman/webman-framework/src/Exception/ExceptionHandler.php的report方法重写vendor/workerman/webman-framework/src/support/Log.php日志类,通过request()->header()可以获取请求头信息,自由拼接需要额外记录的信息

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

2 participants