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, 14 Feb 2022 16:28:17 +0000 (11:28 -0500)
commit37d351b83b6a3cb7ee952364a0bdb5dadfa616bc
tree68f850b3d1eac0de3781ad917693fca8063cd1cc
parentb6659287e99e16eb826ceff27b17cc1058967693
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
src/lib/lttng-ust-java-agent/java/lttng-ust-agent-log4j2/org/lttng/ust/agent/log4j2/LttngLogAppender.java
This page took 0.025915 seconds and 4 git commands to generate.