code: public String logMessage(String strTrxID, BaseMessage trxMessage, String strMessageInfoType, String strMessageProcessType, String strMessageStatus, String strContactType, String strPerson, String strMessageDescription, int iUserID, int iMessageReferenceID, Message message, String strDest)
      {
          Utility.getLogger().info("Sending message to URL: " + strDest);
          String strMessageFrom = null;
          String strMessageTo = null;
          String strContentType = null;
          String strContent = null;
          if (message != null)
          {
              try {
                  Object objContent = message.getContent();
                  strContentType = message.getContentType();
                  Address[] rgstrMessageFrom = message.getFrom();
                  if (rgstrMessageFrom != null) if (rgstrMessageFrom.length > 0)
                      strMessageFrom = rgstrMessageFrom[0].toString();
                  Address[] rgstrMessageTo = message.getAllRecipients();
                  if (rgstrMessageTo != null) if (rgstrMessageTo.length > 0)
                      strMessageTo = rgstrMessageTo[0].toString();
                  if ((strMessageDescription == null) || (strMessageDescription.length() == 0))
                      strMessageDescription = message.getSubject();
                  strContent = objContent.toString();
              } catch (IOException ex)    {
                  ex.printStackTrace();
              } catch (MessagingException ex)    {
                  ex.printStackTrace();
              }
          }
          // Be sure to call super!
          return super.logMessage(strTrxID, trxMessage, strMessageInfoType, strMessageProcessType, strMessageStatus, strMessageDescription, strContentType);
      }
docs: Write this outgoing SOAP message into the log.
  @param msg The message.
  @urlEndpoint The destination.
  @return The message log transaction number.