logging-log4j2 icon indicating copy to clipboard operation
logging-log4j2 copied to clipboard

[MS10] Log4j API generalization #1

Open vy opened this issue 2 years ago • 0 comments

Currently, Log4j 3 contains a new API (log4j-api-3.x) and this is not a good thing. We want to generalize the Log4j 2 API (log4j-api-2.x) as "the Log4j API" and use it in Log4j 3 too. (See the maintainer resolution.) This milestone contributes to that effort.

Log4j 2 API generalization

Log4j 2 API has several parts that are specialized for Log4j 2. This specialization makes it difficult to be a drop-in replacement for Log4j 3 API, which we intend to replace, yet Log4j 3 depends on it with several assumptions. We need to refactor these specialized Log4j 2 API mechanisms such that

  1. They are isolated and self-sustained (so that it doesn't matter if they are used in a Log4j 2 or Log4j 3 context)
  2. They allow plugging in 3rd party business logic (so that Log4j 2 or Log4j 3 can customize their behaviour as they see fit)
  • StatusLogger is the lowest level component of Log4j: the logger for the logging system itself. It is crucial to isolate it from the rest to avoid unexpected cyclic dependencies, e.g, StatusLogger depending on SimpleLogger depending on PropertiesUtil depending on StatusLogger again.
    • #2249
    • #2280

Miscellaneous improvements

In accordance with Boy Scout Rule, things we have improved along the way:

  • #2266
  • #2275

vy avatar Feb 08 '24 12:02 vy