The idea is to able to expose log4j events to outside.
A Nuxeo Appender is added to the log4j2 file, it describes the Kafka access and stream to write the events.
Log entries are encoded in Avro Message encapsulated in Nuxeo Record, this way they follow the same encoding as other Nuxeo streams.
With this format the stream can be exposed (cat or tail) using the Stream Management API as described in the documentation:
https://doc.nuxeo.com/rest-api/1/stream-endpoint/#view-stream-content-cat-and-tail
Note that because events are Avro encoded, they are much more compact and consistent than JSON, also message and thrown fields are truncated if too long to avoid any overload on log4j and/or Kafka.