Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-6144

Root logger context configuration is overwritten when ANY configuration changes

    XMLWordPrintableJSON

    Details

      Description

      The Felix log bundle registers a ConfigurationListener when a ConfigurationAdmin instance is present (https://github.com/apache/felix/blob/7f4bada389ebdaee8b5ae4530c53f2954c8d0fde/log/src/main/java/org/apache/felix/log/Activator.java#L159 and https://github.com/apache/felix/blob/7f4bada389ebdaee8b5ae4530c53f2954c8d0fde/log/src/main/java/org/apache/felix/log/ConfigurationListenerImpl.java#L116). This means it gets notified of ALL configuration events. The implementation of configurationEvent, however, fails to ignore configuration that is not targeted towards the LoggerAdmin. https://github.com/apache/felix/blob/7f4bada389ebdaee8b5ae4530c53f2954c8d0fde/log/src/main/java/org/apache/felix/log/ConfigurationListenerImpl.java#L133 checks whether or not the pid is meant for a non-root logger context and fills in configAdmin if that is the case. In the case it is anything other (not only "org.osgi.service.log.admin"), configAdmin will be null and since the following lines are not guarded by this if, the configuration of the logger context is overwritten by configuration of a random PID (https://github.com/apache/felix/blob/7f4bada389ebdaee8b5ae4530c53f2954c8d0fde/log/src/main/java/org/apache/felix/log/ConfigurationListenerImpl.java#L148), which in normal cases means all log configuration for the logger context is gone at that point.

       

        Attachments

          Activity

            People

            • Assignee:
              cziegeler Carsten Ziegeler
              Reporter:
              jellenelis Jelle Nelis
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified