Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-6044

Conflicting LogManager and LogWriter if using the same logfile

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Commons Log 4.0.2
    • Commons Log 5.1.0
    • Commons
    • None

    Description

      When you have a logmanager and a logwriter pointing to the same file, you get an exception like this:

      07.09.2016 17:33:31.126 ERROR [] CM Configuration Updater (Update: pid=org.apache.sling.commons.log.LogManager) org.apache.felix.configadmin Service [org.apache.felix.cm.ConfigurationAdmin,9, [org.osgi.service.cm.ConfigurationAdmin]] [org.osgi.service.cm.ManagedService, id=10, bundle=7/slinginstall:c:\java\IBM\LibertyProfile\usr\servers\aem-1\sling\_\launchpad\startup\1\org.apache.sling.commons.log-4.0.0.jar]: Updating property org.apache.sling.commons.log.file of configuration org.apache.sling.commons.log.LogManager caused a problem: LogFile C:\java\IBM\LibertyProfile\usr\servers\aem-1\aemlogs\logs\error.log already configured by configuration org.apache.sling.commons.log.LogManager.factory.writer.8402a603-bdef-4404-9ff1-0e0f592578af (org.osgi.service.cm.ConfigurationException: org.apache.sling.commons.log.file : LogFile C:\java\IBM\LibertyProfile\usr\servers\aem-1\aemlogs\logs\error.log already configured by configuration org.apache.sling.commons.log.LogManager.factory.writer.8402a603-bdef-4404-9ff1-0e0f592578af)
      org.osgi.service.cm.ConfigurationException: org.apache.sling.commons.log.file : LogFile C:\java\IBM\LibertyProfile\usr\servers\aem-1\aemlogs\logs\error.log already configured by configuration org.apache.sling.commons.log.LogManager.factory.writer.8402a603-bdef-4404-9ff1-0e0f592578af
              at org.apache.sling.commons.log.logback.internal.config.GlobalConfigurator.updated(GlobalConfigurator.java:32)
              at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:148)
              at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:81)
              at org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1744)
              at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)
              at java.lang.Thread.run(Thread.java:744)
      Caused by: org.apache.sling.commons.log.logback.internal.config.ConfigurationException:
              at org.apache.sling.commons.log.logback.internal.LogConfigManager.updateLogWriter(LogConfigManager.java:398)
              at org.apache.sling.commons.log.logback.internal.LogConfigManager.updateGlobalConfiguration(LogConfigManager.java:327)
              at org.apache.sling.commons.log.logback.internal.config.GlobalConfigurator.updated(GlobalConfigurator.java:30)
              ... 5 common frames omitted

      Obviously the Logmanager internally provides a Logwriter, so these conflict. This should be documented.

      Attachments

        Activity

          People

            chetanm Chetan Mehrotra
            joerghoh Joerg Hoh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: