You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "ning1875 (via GitHub)" <gi...@apache.org> on 2023/06/26 08:50:59 UTC
[GitHub] [apisix] ning1875 opened a new pull request, #9726: log request_header when key set
ning1875 opened a new pull request, #9726:
URL: https://github.com/apache/apisix/pull/9726
### Description
When the log format is configured, it is also expected to print some important request headers such as the release that identifies the lane to help troubleshoot the request problem, so the user needs to configure the header list to be printed
### Checklist
- [ ] I have explained the need for this PR and the problem it solves
- [ ] I have explained the changes or the new features added to this PR
- [ ] I have added tests corresponding to this change
- [ ] I have updated the documentation to reflect this change
- [ ] I have verified that this change is backward compatible (If not, please discuss on the [APISIX mailing list](https://github.com/apache/apisix/tree/master#community) first)
#### eg
- config like this
```shell
"request_header_keys": [
"release",
"env",
]
```
- log like
```shell
"release"="dev",
"env"="stage"
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9726: log request_header when key set
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9726:
URL: https://github.com/apache/apisix/pull/9726#issuecomment-1610793562
It's an nginx variable, and you could refer to this: https://github.com/openresty/lua-nginx-module#ngxvarvariable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] monkeyDluffy6017 closed pull request #9726: log request_header when key set
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 closed pull request #9726: log request_header when key set
URL: https://github.com/apache/apisix/pull/9726
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9726: log request_header when key set
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9726:
URL: https://github.com/apache/apisix/pull/9726#issuecomment-1610794157
I will close this pr, feel free to reopen it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] monkeyDluffy6017 commented on pull request #9726: log request_header when key set
Posted by "monkeyDluffy6017 (via GitHub)" <gi...@apache.org>.
monkeyDluffy6017 commented on PR #9726:
URL: https://github.com/apache/apisix/pull/9726#issuecomment-1609255485
Hi @ning1875, I don't think you need to create this pr to implement this function.
You could record the request header like this
```
curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/file-logger -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
{
"log_format": {
"release": "$http_release",
}
}'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [apisix] ning1875 commented on pull request #9726: log request_header when key set
Posted by "ning1875 (via GitHub)" <gi...@apache.org>.
ning1875 commented on PR #9726:
URL: https://github.com/apache/apisix/pull/9726#issuecomment-1610702777
> Hi @ning1875, I don't think you need to create this pr to implement this function. You could record the request header like this, we suppose the nginx and apisix variable
>
> ```
> curl http://127.0.0.1:9180/apisix/admin/plugin_metadata/file-logger -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' -X PUT -d '
> {
> "log_format": {
> "release": "$http_release",
> }
> }'
> ```
test ok ,it works 。so does it support by openresty ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org