code: protected static String message(Object message)
    {
      if(message == null) {
        return null;
      }
      if(!(message instanceof Throwable)) {
        return message.toString();
      }
  
      Throwable t = (Throwable)message;
      if(t.getCause() == null) {
        return t.toString();
      }
  
      int nestingLevel = 0;
      StringBuilder sb = new StringBuilder();
      for(;;) {
        sb.append(t.getClass().getName());
        sb.append(":");
        sb.append(" ");
        if(++nestingLevel == 8) {
          sb.append("...");
          break;
        }
        if(t.getCause() == null) {
          String s = t.getMessage();
          if(s == null) {
            t.getClass().getCanonicalName();
          }
          sb.append(s);
          break;
        }
        t = t.getCause();
      }
      return sb.toString();
    }
docs: Normalize log message. This method returns message to string; if message is a Throwable and has not null cause
  returns cause hierarchy formed from cause class name.
  
  @param message log message.
  @return normalized log message or null.