[
https://issues.apache.org/jira/browse/HDDS-445?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16642229#comment-16642229
]
Bharat Viswanadham commented on HDDS-445:
-----------------------------------------
Adding below to log4j.properties, we will be able to log the HTTP request logs.
There is already framework support to do this in hadoop-common.
log4j.logger.http.requests.s3gateway: INFO,s3gatewayrequestlog
log4j.appender.s3gatewayrequestlog.Filename: /tmp/jetty-s3gateway-yyyy_mm_dd.log
log4j.appender.s3gatewayrequestlog.RetainDays: 3
I see for other components like namenode these are added to log4j.properties in
hadoop-common. For S3Gateway also do we need to add it over there in commented?
[https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/conf/log4j.properties#L249]
*Snippet from testing on docker cluster:*
{code:java}
172.20.0.1 - - [08/Oct/2018:17:49:34 +0000] "HEAD
//localhost:9878/volume1/bucket1212 HTTP/1.1" 404 0 "-" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/69.0.3497.100 Safari/537.36"
172.20.0.1 - - [08/Oct/2018:17:50:25 +0000] "POST
//localhost:9878/volume1/bucket1212 HTTP/1.1" 405 268 "-" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/69.0.3497.100 Safari/537.36"
172.20.0.1 - - [08/Oct/2018:17:50:32 +0000] "GET
//localhost:9878/volume1/bucket1212 HTTP/1.1" 404 233 "-" "Mozilla/5.0
(Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/69.0.3497.100 Safari/537.36"
{code}
> Create a logger to print out all of the incoming requests
> ---------------------------------------------------------
>
> Key: HDDS-445
> URL: https://issues.apache.org/jira/browse/HDDS-445
> Project: Hadoop Distributed Data Store
> Issue Type: Sub-task
> Reporter: Elek, Marton
> Assignee: Bharat Viswanadham
> Priority: Major
>
> For the Http servier of HDDS-444 we need an option to print out all the
> HttpRequests (header + body).
> To create a 100% s3 compatible interface, we need to test it with multiple
> external tools (such as s3cli). While mitmproxy is always our best friend, to
> make it more easier to identify the problems we need a method to log all the
> incoming requests with a logger which could be turned on.
> Most probably we already have such kind of filter in hadoop/jetty the only
> thing what we need is to configure it.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]