I need to find a way to prevent large payloads to be logged when an exception occurs.
I’m sending large files (about 30MB) through FTP, when the connection times out the whole payload content is logged.
[01-10-2012 10:32:59:059] ERROR exception.DefaultMessagingExceptionStrategy:
********************************************************************************
Message : Connection timed out (java.net.ConnectException)
Code : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Connection timed out (java.net.ConnectException)
java.net.PlainSocketImpl:-2 (null)
2. Connection timed out (java.net.ConnectException) (org.mule.transport.ConnectException)
org.mule.transport.ftp.FtpConnector:556 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/transport/ConnectExcepti
on.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
+ 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)
********************************************************************************
[01-10-2012 10:32:59:059] ERROR exception.DefaultMessagingExceptionStrategy: Message being processed is:
+++++++++++LARGE_PAYLOAD_CONTENT++++++++++++++
.
.
.
.
.
With Mule 3.3.0 the only option is to set configure the logger of
org.mule.exception.DefaultMessagingExceptionStrategytoFATAL(via the Log4j configuration).This has been fixed in Mule 3.3.1 / 3.4.0-SNAPSHOT: full message payload is now logged only if the logger of
org.mule.exception.DefaultMessagingExceptionStrategyis set toDEBUG.