如果您仅使用Jersey客户端API,则LoggingFilter(客户端过滤器)应该可以帮助您:
Client client = Client.create();client.addFilter(new LoggingFilter(System.out));WebResource webResource = client.resource("http://localhost:9998/");ClientResponse response = webResource.accept(MediaType.APPLICATION_JSON) .get(ClientResponse.class);否则,您可以使用其他LoggingFilter(容器过滤器)再次在服务器上记录请求和响应。



