@Override
  public void doEncode(ILoggingEvent event) throws IOException {

    write(formatter.writeValueAsBytes(event, getContext()), outputStream);
    write(CoreConstants.LINE_SEPARATOR, outputStream);

    if (immediateFlush) {
      outputStream.flush();
    }
  }
 public void setCustomFields(String customFields) {
   try {
     formatter.setCustomFields(parseCustomFields(customFields));
   } catch (JsonParseException e) {
     addError("Failed to parse custom fields [" + customFields + "]", e);
   } catch (JsonProcessingException e) {
     addError("Failed to parse custom fields [" + customFields + "]", e);
   } catch (IOException e) {
     addError("Failed to parse custom fields [" + customFields + "]", e);
   }
 }
 public String getCustomFields() {
   return formatter.getCustomFields().toString();
 }
 public void setIncludeCallerInfo(boolean includeCallerInfo) {
   formatter.setIncludeCallerInfo(includeCallerInfo);
 }
 public boolean isIncludeCallerInfo() {
   return formatter.isIncludeCallerInfo();
 }