@Override
public void format(OutputStream o, Event e) throws IOException {
JsonGenerator g = jsonFactory.createJsonGenerator(o, JsonEncoding.UTF8);
g.writeStartObject();
g.writeStringField("body", new String(e.getBody()));
g.writeNumberField("timestamp", e.getTimestamp());
g.writeStringField("pri", e.getPriority().toString());
g.writeNumberField("nanos", e.getNanos());
g.writeStringField("host", e.getHost());
g.writeObjectFieldStart("fields");
for (Entry<String, byte[]> a : e.getAttrs().entrySet()) {