[
https://issues.apache.org/jira/browse/CAMEL-9102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14728000#comment-14728000
]
ASF GitHub Bot commented on CAMEL-9102:
---------------------------------------
GitHub user bmvisioli opened a pull request:
https://github.com/apache/camel/pull/605
CAMEL-9102: Changed CxfEndpoint to allow loggingSizeLimit=-1
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/bmvisioli/camel cxf-log-limit
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/camel/pull/605.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #605
----
commit e568527f8450071fabfdb33657207860bac7e2f4
Author: Bruno Marco Visioli <[email protected]>
Date: 2015-09-02T20:21:21Z
CAMEL-9102: Changed CxfEndpoint to allow loggingSizeLimit=-1 for unlimited
log size
commit 538d2dfb1ab95d1301ea64e8382ce724d9c89d6d
Author: Bruno Marco Visioli <[email protected]>
Date: 2015-09-02T20:40:42Z
CAMEL-9102: Added loggingSizeLimit >= -1 validation in
setLoggingSizeLimit() to avoid further errors
commit e6c08a33c1765d96740e436b74d1043cfed3d95c
Author: Bruno Marco Visioli <[email protected]>
Date: 2015-09-02T20:45:51Z
CAMEL-9102: Changed tabs to whitespace for identation
----
> 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: Trivial
>
> 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)