You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Volkan Yazıcı <vo...@gmail.com> on 2020/06/07 20:51:27 UTC

JsonTemplateLayout is ready for public review

Hello,

Regarding JsonTemplateLayout, I've just pushed the following changes
to the master:

1. Set the default template to ECS[1]. Picking a default is a
   delicate process and has quite some implications in the long
   term. After evaluating the existing options (incl. no default at
   all!), I have decided to go with ECS. ELK stack is the de facto
   log sink in the wild and appears to be dominating the market
   in the long run too. Hence, I think it is wise to choose an option
   that would create the least amount of friction for users.

2. Replaced the `${json:*}` configuration DSL with JSON. This
   enables a way more versatile configuration syntax without
   parsing issues.

3. Replaced `KeyValuePair[]` in `EventTemplateAdditionalFields`
   with a custom `EventTemplateAdditionalField[]`. This enhances
   `KeyValuePair` with an extra `type` argument: `string` or `json`.
   This allows users to introduce additional fields that a) leverage
   JSON templating syntax and b) contain typed values, e.g.,
   number, list, object, etc. (See the docs for details.)

4. Added optimization to skip empty elements; i.e., empty lists,
   objects and null values. This optimization is available for nested
   structures too; e.g, an object with all null values.

5. Improved the javadoc and manual quite a bit.

Though I need some guidance/feedback on the following points:

1. There are eventTemplateUri and stackTraceElementTemplateUri
   parameters. There only "file" and "classpath" schemes are
   supported. Shall I rename these to `*Url`? Or `*Uri` is fine?

2. Please check out json-template-layout.html. Do you have any
   remarks?

3. In json-template-layout.html, see the `#event-template-resolvers`
   table? Notice how the vertical cell alignment distorts the view?
   How can I fix this?

Cheers!

[1] https://www.elastic.co/guide/en/ecs/current/ecs-reference.html