code: public void handleEvent(Event event) {
          LOG.fine("ContentLengthHandler called");
  
          //if maximum length is shorter then <cut><![CDATA[ ]]></cut> it's not possible to cut the content
          if(CUT_START_TAG.length() + CUT_END_TAG.length() > length) {
              LOG.warning("Trying to cut content. But length is shorter then needed for "
                  + CUT_START_TAG + CUT_END_TAG + ". So content is skipped.");
              event.setContent("");
              return;
          }
  
          int currentLength = length - CUT_START_TAG.length() - CUT_END_TAG.length();
  
          if (event.getContent() != null && event.getContent().length() > length) {
              LOG.fine("cutting content to " + currentLength
                      + " characters. Original length was "
                      + event.getContent().length());
              LOG.fine("Content before cutting: " + event.getContent());
              event.setContent(CUT_START_TAG
                      + event.getContent().substring(0, currentLength) + CUT_END_TAG);
              LOG.fine("Content after cutting: " + event.getContent());
          }
      }
docs: Cut the message content to the configured length.
  
  @param event the event