Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8AE2317EE1 for ; Wed, 26 Aug 2015 12:38:46 +0000 (UTC) Received: (qmail 91204 invoked by uid 500); 26 Aug 2015 12:38:46 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 91167 invoked by uid 500); 26 Aug 2015 12:38:46 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 91157 invoked by uid 99); 26 Aug 2015 12:38:46 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Aug 2015 12:38:46 +0000 Date: Wed, 26 Aug 2015 12:38:46 +0000 (UTC) From: "Bruno Marco Visioli (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CAMEL-9102) CxfEndpoint could use loggingSizeLimit = -1 for no size limit MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Bruno Marco Visioli created CAMEL-9102: ------------------------------------------ Summary: CxfEndpoint could use loggingSizeLimit = -1 for no size limit Key: CAMEL-9102 URL: https://issues.apache.org/jira/browse/CAMEL-9102 Project: Camel Issue Type: Improvement Components: camel-cxf, camel-cxfrs Affects Versions: 2.15.3 Reporter: Bruno Marco Visioli Priority: Minor When creating a CxfEndpoint, setting a loggingSizeLimit -1 to disable limiting payload logging cause no effect due to the code bellow. CXF own LoggingIn/OutInterceptor code accept -1 as unlimited. org.apache.camel.component.cxf.CxfEndpoint {code:java} if (getLoggingSizeLimit() > 0) { sfb.getFeatures().add(new LoggingFeature(getLoggingSizeLimit())); } else { sfb.getFeatures().add(new LoggingFeature()); } {code} org.apache.cxf.feature.LoggingFeature {code:java} private static final int DEFAULT_LIMIT = AbstractLoggingInterceptor.DEFAULT_LIMIT; private static final LoggingInInterceptor IN = new LoggingInInterceptor(DEFAULT_LIMIT); private static final LoggingOutInterceptor OUT = new LoggingOutInterceptor(DEFAULT_LIMIT); int limit = DEFAULT_LIMIT; public LoggingFeature() {} protected void initializeProvider(InterceptorProvider provider, Bus bus) { if (limit == DEFAULT_LIMIT && inLocation == null && outLocation == null && !prettyLogging) { provider.getInInterceptors().add(IN); provider.getInFaultInterceptors().add(IN); provider.getOutInterceptors().add(OUT); provider.getOutFaultInterceptors().add(OUT); } else { //Creates and uses new Interceptors with specified limit } {code} org.apache.cxf.interceptor.LoggingInInterceptor {code:java} public LoggingInInterceptor(int lim) { this(); limit = lim; } protected void logInputStream(Message message, InputStream is, LoggingMessage buffer, String encoding, String ct) { (...) //only copy up to the limit since that's all we need to log //we can stream the rest IOUtils.copyAtLeast(bis, bos, limit == -1 ? Integer.MAX_VALUE : limit); {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)