Skip to content

Custom logging format #35812

Description

@inad9300

I would like to minimize logging noise. At the moment, I find that built-in trace formats either contain undesirable information or not enough of it. I would love for it to be a way to specify a custom format.

The closest to my goal is probably the "ENHANCED" trace format, which is the one I have settled on. Here is an example of a log line using that format, when running the application via Open Liberty's Maven plugin:

[INFO] [2026-09-17T08:30:22.989+0000] 00000aab id=         org.example.app.SomeApplicationClass        1 An event worth logging.

Here is what I would ideally like it to become:

[2026-09-17T08:30:22.989] SomeApplicationClass [FINE] An event worth logging.

Some notes:

  • The "[INFO]" in every line when using the Maven plugin is misleading, and pointless.
  • Having the timezone repeated in every line isn't necessary.
  • The thread ID is very rarely useful, so it would be best activated on demand for specific cases.
  • Not once have I seen a value for object ID. I don't really know what it is, but I don't think it adds any value.
  • The fully qualified class name is often too much, as it's rare to find ambiguity, and it can usually be resolved by looking at the other information.
  • I struggle to get used to "1", "2" and "3" to indicate "FINE[R|ST]" logging levels.

I would appreciate if you could look at this and consider either providing finer-grain configuration options for existing formats, or a more flexible way to specify new, custom ones, perhaps with a syntax similar to the pattern descriptions used in the documentation, e.g.

<time stamp> <thread ID> <object ID> <fully qualified class name of logger> <log level attribute> [<method name>] <message>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions