code: public String applyFields(final String replaceText,
                              final LoggingEvent event) {
        if (replaceText == null) {
          return null;
        }
        InFixToPostFix.CustomTokenizer tokenizer = new InFixToPostFix.CustomTokenizer(replaceText);
        StringBuffer result = new StringBuffer();
        boolean found = false;
  
        while (tokenizer.hasMoreTokens()) {
            String token = tokenizer.nextToken();
            if (isField(token) || token.toUpperCase(Locale.US).startsWith(PROP_FIELD)) {
                result.append(getValue(token, event).toString());
                found = true;
            } else {
                result.append(token);
            }
        }
        if (found) {
          return result.toString();
        }
        return null;
    }
docs: Apply fields.
  @param replaceText replacement text.
  @param event logging event.
  @return evaluted expression