Details

    • Type: Question Question
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta1
    • Fix Version/s: 2.0-beta3
    • Component/s: Configurators
    • Labels:
    • Environment:

      Windows 7 x64, Java 7 x86, Eclipse 3.8.1 x86, Eclipse RCP plugin application

      Description

      Hello,

      since two days I'm working with Log4j 2 . I try to migrate from Log4J. I'm using it in an Eclipse application. I put the necessary jars of the binary distribution into a basic plugin and a log4j2.xml into the root. This worked well so far. Now I tried to add a custom appender to log4j. The class is in the default source package of the Eclipse plugin. Annotations are set like in the homepage documentation.

      In the first try I tried to provide the package of the Appender via the log4j2.xml. I set the attribute package in the configuration element. It seemed to me, the attribute is completely ignored? At least the class from the given package was not loaded.

      In the second try I tried to provide the package via the static method '...log4j.core.config.plugin.PluginManager.addPackage'. I debugged the method to get a hint why it didn't work. It tried to transform my package 'com.application.logging' into a URI 'com/application/logging' and started to search with it somehow. It might have found them treating them as file, as the classes were lying in a subdirectory. But as there was no file scheme in the beginning of the URI, it searched a not existing jar.

      The XML parser of the configuration can't resolve the name of my appender in the end.

      Do you have an idea then I do anything wrong, or then there is an open issue? I can provide more details on request. Is there a programmatical way to register my appender to Log4J 2 before the Logger initialization?

      Sincerely
      Robert Breunung

      1. happyTestProject.rftjdtr
        4 kB
        Aaron Shepherd
      2. Desktop.png
        453 kB
        Robert Breunung
      3. LogDemo.zip
        2.39 MB
        Robert Breunung

        Activity

          People

          • Assignee:
            Ralph Goers
            Reporter:
            Robert Breunung
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development