http 연결에서 스트림 데이터를 가져오고 있습니다. log4j를 사용하여 로그 파일에 스트림을 기록하고 싶습니다. log4j를 사용하여 로그 스트림 데이터
나는 (유지되어야 함)내가 어떻게 할 수있는 몇 가지 다른 작업을 수행 할 더이 스트림이 필요하십니까? http://www.java2s.com/Open-Source/Java/Testing/jacareto/jacareto/toolkit/log4j/LogOutputStream.java.htm
에서
StreamUtils.copy(xml, new LogOutputStreamUtil(log, Level.INFO));
곳 LogOutputStreamUtil 그러나 즉시가 기록했기 때문에 :
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
connection.setRequestProperty("Accept", "application/xml");
InputStream xml = connection.getInputStream();
나는이 일을 시도했다. 스트림이 닫혀지고 :(