4

Good afternoon,

I'm running Apache Tomcat 7.0.57 under GNU/Linux CentOS 6.6 Final and with this JAVA_OPTS:

-server\
-Xms512m\
-Xmx512m\
-XX:MaxPermSize=256m\
-XX:MaxNewSize=160m\
-XX:NewSize=160m\
-XX:SurvivorRatio=128\
-XX:MaxTenuringThreshold=0\
-XX:+UseConcMarkSweepGC\
-XX:+CMSIncrementalMode\
-XX:+CMSIncrementalPacing\
-XX:+CMSClassUnloadingEnabled\
-XX:+DisableExplicitGC\
-XX:+UseParNewGC\
-XX:+UseTLAB\
-Djava.net.preferIPv4Stack=true\
-Djava.net.preferIPv4Addresses\
-Dgrails.env=prod\
-Dspring.profiles.active=prod\
-Dport-offset=0\
-Dajp.port=8009\
-Dhttp.port=8080\
-Dhttp.maxthreads=457\
-Dshutdown.port=8005\
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true

And the log file has the following:

Inbound Message
----------------------------
ID: 66210
Response-Code: 200
Encoding: ISO-8859-1
Content-Type: text/xml
Headers: {Content-Length=[6693], content-type=[text/xml]}
Messages:
Message (saved to tmp file):
Filename: /usr/local/services/tomcat_02/temp/cxf-tmp-720465/cos4330744862698212100tmp
(message truncated to 65536 bytes)

Payload: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

What can I do to increment the number of bytes of the message?

Thanks!

Jose Monreal Bailey
  • 461
  • 1
  • 5
  • 12

4 Answers4

2

Try to set the limit of the LoggingOutInterceptor to a bigger size. In some versions of the cxf-api this limit is set to a default size of 100 * 1024

private int limit = 100 * 1024;

If you would like to have the entire message you should set it to -1 In Spring it would be something like this:

<property name="limit" value="-1"/>
panagdu
  • 2,133
  • 1
  • 21
  • 36
  • But the property in what file should it go? under what tag? Thanks – Jose Monreal Bailey Jan 19 '15 at 19:48
  • 1
    You can set it directly in the constructor - LoggingOutInterceptor(int lim) or with the setLimit method - public void setLimit(int lim) – panagdu Jan 19 '15 at 21:01
  • There's no way to put it in a configuration file, without altering the code? – Jose Monreal Bailey Jan 19 '15 at 21:57
  • Yes you can, but I don't know what framework you are using: Spring, Apache Aries, Guice etc ? And how does your configuration file look like ? – panagdu Jan 20 '15 at 07:07
  • Hi @panagdu I am also facing the same issue with my interceptor which extends LoggingOutInterceptor. The message is getting trucated after 49149 spaces. Should I use super(-1) inside the child class constructor? – tvshajeer Apr 26 '17 at 13:17
2

CXF option loggingSizeLimit="-1" will prevent the message to be truncated.

1

For who are using CXF within Spring, the solution is to declare the bean for loggingInInterceptor or loggingOutInterceptor with a construcotr-arg parameter, in the following way:

<bean id="loggingInInterceptor" class="org.apache.cxf.interceptor.LoggingInInterceptor" parent="abstractLoggingInterceptor">
    <constructor-arg name="lim" value="-1"/>
</bean>

In that way, the interceptor is created using the constructor which set a custom value for the limit of the log. The message is not truncated with any negative value.

Alessandro C
  • 3,310
  • 9
  • 46
  • 82
0

If you just want to check what's inside - put a breakpoint in CXF's LoggingOutInterceptor / LogginInInterceptor class, near the

(message truncated to " + limit + " bytes)

and copy contents of output / input stream

snp0k
  • 398
  • 1
  • 5
  • 12