Skip to content

ECS formatter for JUL (java.util.logging) #68

@redrathnure

Description

@redrathnure

What about idea to implement ECS formatter for JUL (java.util.logging)?

Motivation

there are bunch of old and very old application which use JUL as logging backend. E.g. Tomcat, Tanuki Wrapper and products based on these applications.
Sometimes is it not easy to switch logging framework, sometimes it's not possible to do this at all. But it would be nice to have logs in ECS format and as option (relatively simple?) we may have class EcsFormatter extends java.util.logging.Formatter.

Open Issues

When I tried to implement it I met a few issues:

  • there are no file related metainformation (file name, line etc).
  • looks like no thread name, only thread ID
  • no MDC or something similar concept
  • JUL has bit different log levels and looks like we need mapping between JUL and classical DEBUG/INFO/WARN/ERROR vales. The mapping does not look so pretty, but it is work.

So looks like EcsFormatter class may produce ECS-compatible record, but some of feature will be missed and seems some of AbstractEcsLoggingTest unit tests will be failed.

Questions

  1. Does it have sense to implement EcsFormatter?
  2. If yes, how to deal with test cases from AbstractEcsLoggingTest and not supported features like MDC and file meta information?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions