You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Robert Munteanu (JIRA)" <ji...@apache.org> on 2016/11/18 16:19:58 UTC

[jira] [Commented] (SLING-6044) Conflicting LogManager and LogWriter if using the same logfile

    [ https://issues.apache.org/jira/browse/SLING-6044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15677064#comment-15677064 ] 

Robert Munteanu commented on SLING-6044:
----------------------------------------

I also tried to create duplicate config files on disk so that they have the same PID, e.g. in {{$SLING_HOME/config/org/apache/sling/commons/log/LogManager/factory/config/}} I copied 08d4a446-0787-40b6-a257-d2db9e33721f.config to 08d4a446-0787-40b6-a257-d2db9e33721f-dup.config but Sling started without issues, and no additional LogManager configuration factory instances were present in the web console. I was able to alter the respective OSGi config and it was persisted to disk.

> Conflicting LogManager and LogWriter if using the same logfile
> --------------------------------------------------------------
>
>                 Key: SLING-6044
>                 URL: https://issues.apache.org/jira/browse/SLING-6044
>             Project: Sling
>          Issue Type: Improvement
>          Components: Commons
>    Affects Versions: Commons Log 4.0.2
>            Reporter: Jörg Hoh
>            Assignee: Chetan Mehrotra
>             Fix For: Commons Log 5.0.2
>
>         Attachments: SLING-6044-multiple-loggers-writers.jpg
>
>
> When you have a logmanager and a logwriter pointing to the same file, you get an exception like this:
> {panel}
> 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
> {panel}
> Obviously the Logmanager internally provides a Logwriter, so these conflict. This should be documented.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)