If you have a WebServiceMessage object and you have a need to log that message to a Log4j Logger this is some quick code to do just that...
Log log = LogFactory.getLog("LoggerName");
WebServiceMessage message = wsMessage;
ByteArrayOutputStream os = new ByteArrayOutputStream();
message.writeTo(os);
log.error(os.toString());



0 Comments:
Post a Comment