2016-08-19 6 views
0

私は[http.async.client "1.0.1"]をClojureのHTTPクライアントとして使用しています。これは、私が気にしないデバッグメッセージと私が要求するHTTPヘッダー(私が気にしている)の両方と、その答えを表示します。ここでhttp.async.clientはヘッダを出力します

は、一般的な出力です:

16-08-19 18:37:36 Nilss-Air.fritz.box DEBUG [com.ning.http.client.providers.netty.request.NettyConnectListener:68] - Using non-cached Channel [id: 0x044195db, /192.168.178.22:52009 => google.com/172.217.20.110:80] for GET '/' 
16-08-19 18:37:36 Nilss-Air.fritz.box DEBUG [com.ning.http.client.providers.netty.handler.HttpProtocol:409] - 

Request DefaultHttpRequest(chunked: false) 
GET/HTTP/1.1 
Connection: keep-alive 
Host: google.com 
Accept: */* 
User-Agent: http.async.client 

Response DefaultHttpResponse(chunked: false) 
HTTP/1.1 302 Found 
Cache-Control: private 
Content-Type: text/html; charset=UTF-8 
Location: http://www.google.de/?gfe_rd=cr&ei=8FG3V8nHAuag8weWr5DYCg 
Content-Length: 258 
Date: Fri, 19 Aug 2016 18:37:36 GMT 

16-08-19 18:37:36 Nilss-Air.fritz.box DEBUG [com.ning.http.client.providers.netty.channel.ChannelManager:297] - Adding key: http://google.com:80 for channel [id: 0x044195db, /192.168.178.22:52009 => google.com/172.217.20.110:80] 

は、どのように私はそれを無効にしますか?

答えて

0

あなたのデバッグ出力がfollowing line in com.ning.http.client.providers.netty.handler.HttpProtocol.handleHttpResponseから来ている:

logger.debug("\n\nRequest {}\n\nResponse {}\n", httpRequest, response); 

デバッグメッセージの内容を変更することはできません現在の形で。

代わりに独自のログロジックを作成できます。要求パラメーターをクライアント関数に渡し、すべての関連する応答データも含む応答マップを返します。興味のある部分を検査し、好みのフォーマットでそれらを記録する機能を書くことができます。 http.async.client docs contain all the relevant information.

関連する問題