Add 'domain' parameter to the Log4j 2.x agent
authorMichael Jeanson <mjeanson@efficios.com>
Thu, 10 Feb 2022 15:25:02 +0000 (15:25 +0000)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Mon, 21 Feb 2022 15:16:43 +0000 (10:16 -0500)
commitaa774a999447eae79376e31f60f4454bc6ff517d
tree615ab31312c309dfa3f08e6bb1c2fcaa2ec65e3b
parentb187a6b350f0c7f27d179cf898e8e85d82ec8dbf
Add 'domain' parameter to the Log4j 2.x agent

The initial Log4j 2.x agent commit only implemented a compatibility mode
to be used with the existing LOG4J domain in lttng-tools.

In this mode the agent converts the new Log4j 2.x loglevel values to
their corresponding Log4j 1.x values in the same way the upstream
compatibility bridge does.

This is great when doing in-place migration using the upstream
compatibility bridge but doesn't cover the usecase of an application
that natively uses Log4j 2.x.

This commit adds a new mandatory 'domain' parameter to the Log4j2 agent
which currently only implements the 'LOG4J' compatibility domain in
preparation to adding a 'LOG4J2' domain.

The configuration for a single appender in Log4j 1.x compat mode will
now look like this:

    <?xml version="1.0" encoding="UTF-8"?>
    <Configuration status="WARN">
      <Appenders>
        <Lttng name="LTTNG" domain="LOG4J"/>
      </Appenders>
      <Loggers>
        <Root level="all">
          <AppenderRef ref="LTTNG"/>
        </Root>
      </Loggers>
    </Configuration>

Change-Id: I7fd5f79ad58c77175714bd4198d8ff5db2e6b846
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
doc/examples/java-log4j2-basic/log4j2.xml
doc/examples/java-log4j2-ctx/log4j2.ctx1.xml
doc/examples/java-log4j2-ctx/log4j2.ctx2.xml
doc/examples/java-log4j2-prog/HelloLog4j2Prog.java
liblttng-ust-java-agent/java/lttng-ust-agent-log4j2/org/lttng/ust/agent/log4j2/LttngLogAppender.java
This page took 0.025333 seconds and 4 git commands to generate.