Skip to content

Latest commit

 

History

History
35 lines (30 loc) · 1.29 KB

File metadata and controls

35 lines (30 loc) · 1.29 KB

Apache Log4j Samples: custom lookups

This project shows how to write a custom lookup.

In order to use it:

  1. install the artifact and its parent locally with mvn install,

  2. add it to your Maven project:

    <dependency>
      <groupId>org.apache.logging.log4j.samples</groupId>
      <artifactId>log4j-samples-loggerProperties</artifactId>
      <version>2.19.1-SNAPSHOT</version>
    </dependency>
  3. use $${custom:some_key} in the pattern of your pattern layout,

  4. in your code assign some properties to a logger using CustomLookup#setLoggerProperties.