【发布时间】:2022-12-09 21:48:11
【问题描述】:
我们按照以下文档在 HTTP 访问日志中打印自定义请求标头,但面临一些挑战
**Option 1**: We added below entries in /repository/conf/deployment.toml file
[http_access_log]
useLogger = true
pattern = "%{X-Forwarded-For}i %h %l %u %t %r %s %b %{Referer}i %{User-Agent}i %{X-Custom-Header}i %T"
The changes are reflecting in HOME\repository\conf\tomcat\catlina-server.xml but the custom headers are not getting printed.
**Option 2**: Created a separate log file as mentioned in "Configuring access logs for PassThrough or NIO transports in API Gateway" section. With this we are able to print the custom headers but the response code is not getting printed. It is appearing as "-".
Log format: access_log_pattern=%{X-Forwarded-For}i %h %l %u %t %r %s \"%{Referer}i\" \"%{User-Agent}i\" %{X-Custom-Header}i %B
Example log entry: - 10.73.122.48 - - [06/Dec/2022:14:49:36.628 +0530] "GET /mcm-stubs/testservice HTTP/1.1" **-** "-" "Synapse-PT-HttpComponents-NIO" "-" -
请帮忙
【问题讨论】:
标签: wso2 wso2-api-manager