[ 
https://issues.apache.org/jira/browse/CXF-7562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16253325#comment-16253325
 ] 

ASF GitHub Bot commented on CXF-7562:
-------------------------------------

forsthofer commented on a change in pull request #340: [CXF-7562] correction 
for truncated flag
URL: https://github.com/apache/cxf/pull/340#discussion_r151102002
 
 

 ##########
 File path: 
rt/features/logging/src/main/java/org/apache/cxf/ext/logging/LoggingOutInterceptor.java
 ##########
 @@ -82,7 +82,10 @@ private OutputStream createCachingOut(Message message, 
final OutputStream os, Ca
             newOut.setThreshold(threshold);
         }
         if (limit > 0) {
-            newOut.setCacheLimit(limit);
+            // make the limit for the cache greater than the limit for the 
truncated payload in the log event, 
+            // this is necessary for finding out that the payload was 
truncated 
+            //(see boolean isTruncated = cos.size() > limit && limit != -1;)  
in method copyPayload
+            newOut.setCacheLimit(limit + 1);
 
 Review comment:
   instead of just setting the limit to 'limit +1' one should check whether the 
limit == Integer.MAX_VALUE and if this is the case just use Integer.MAX_VALUE

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> ext.logging: truncated flag not set 
> ------------------------------------
>
>                 Key: CXF-7562
>                 URL: https://issues.apache.org/jira/browse/CXF-7562
>             Project: CXF
>          Issue Type: Bug
>          Components: logging
>    Affects Versions: 3.1.14, 3.2.1
>            Reporter: Franz Forsthofer
>             Fix For: 3.1.15, 3.2.2
>
>
> In the ext.logging feature the log event (LogEvent) has the attribute 
> truncated which indicates whether the logged payloud was trancated or not. 
> This attribute is not set correctly by the interceptors
> - org.apache.cxf.ext.logging.LoggingInInterceptor
> - org.apache.cxf.ext.logging.LoggingOutInterceptor
> I will add a patch via github.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to