Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-2830

How to merge an additional `log4j.xml` file post-initialisation?

    XMLWordPrintableJSON

    Details

    • Type: Question
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.13.2
    • Fix Version/s: None
    • Labels:
    • Environment:
      • Java 1.8
      • Log4j2 2.13.2
      • Gradle 6.3

      Description

      I am creating an add-on for a framework which, by the time my add-on begins to load, has already established and loaded its own `log4j.xml` file. I would like to have my `log4j.xml` file merged and loaded.

       

      I am able to manually achieve this by, in development, modifying the run configuration to include my `log4j.xml` path in the `-log4j.configurationFile=their_file.xml,my_file.xml`. But this is not a solution.

       

      I cannot find a way to have my add-on run some static code before the framework.

      Is it possible for the framework to remove their hardcoded configuration path, and allow Log4j2 to automatically search and find all `log4j.xml` files on the class path?

        Attachments

        1. Untitled Diagram.jpg
          13 kB
          Axieum

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Axieum Axieum
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: