adobe / aem-project-archetype

Maven template to create best-practice websites on AEM.
https://experienceleague.adobe.com/docs/experience-manager-core-components/using/developing/archetype/overview.html
Apache License 2.0
547 stars 423 forks source link

Logger configs break Logging #7

Closed catalinbuzoiu closed 10 years ago

catalinbuzoiu commented 10 years ago

The Logger configs provided in the archetype are breaking the normal logging of the AEM instance. After first deployment of the package, this is what I see as the last line in error.log:

03.10.2014 11:36:41.128 *INFO* [JcrInstaller.1] org.apache.sling.installer.provider.jcr.impl.JcrInstaller Registering resource with OSGi installer: [InstallableResource, priority=200, id=/apps/lego/config/org.apache.sling.commons.log.LogManager.factory.config-mgp]
03.10.2014 11:36:41.183 *INFO* [OsgiInstallerImpl] org.apache.sling.audit.osgi.installer Installed configuration org.apache.sling.commons.log.LogManager.factory.config.b8d6cd0c-e48c-4b73-bf9d-cf189e932318 from resource TaskResource(url=jcrinstall:/apps/lego/config/org.apache.sling.commons.log.LogManager.factory.config-mgp, entity=config:org.apache.sling.commons.log.LogManager.factory.config.mgp, state=INSTALL, attributes=[org.apache.sling.installer.api.tasks.ResourceTransformer=:27:84:, service.factoryPid=org.apache.sling.commons.log.LogManager.factory.config, service.pid=mgp], digest=491c6b6ab83b703942ffc3a726a9b999)

And everything start to be written in stdout.log aftewards, including these Logger errors:

11:36:41,458 |-INFO in org.apache.sling.commons.log.logback.internal.util.SlingRollingFileAppender[/logs/my-aem-project.log] - Active log file name: /Users/cbuzoiu/cq/instances/
sp1/crx-quickstart/logs/my-aem-project.log
11:36:41,458 |-INFO in org.apache.sling.commons.log.logback.internal.util.SlingRollingFileAppender[/logs/my-aem-project.log] - File property is set to [/Users/cbuzoiu/cq/instanc
es/sp1/crx-quickstart/logs/my-aem-project.log]
11:36:41,458 |-INFO in LogWriter{configurationPID='null', fileName='/Users/cbuzoiu/cq/instances/sp1/crx-quickstart/logs/my-aem-project.log', logNumber=7, logRotation=''.'yyyy-MM
-dd'} - Completed configuring appender with name /Users/cbuzoiu/cq/instances/sp1/crx-quickstart/logs/my-aem-project.log
11:36:41,459 |-ERROR in org.apache.sling.commons.log.logback.internal.LogbackManager@47befe3d - Error occurred while configuring Logback java.lang.IllegalArgumentException: Cann
ot format given Object as a Date
        at java.lang.IllegalArgumentException: Cannot format given Object as a Date
        at      at java.text.DateFormat.format(DateFormat.java:301)
        at      at java.text.Format.format(Format.java:157)
        at      at java.text.MessageFormat.subformat(MessageFormat.java:1313)
        at      at java.text.MessageFormat.format(MessageFormat.java:860)
        at      at java.text.Format.format(Format.java:157)
        at      at java.text.MessageFormat.format(MessageFormat.java:836)
        at      at org.apache.sling.commons.log.logback.internal.LogConfig.createLayout(LogConfig.java:124)
        at      at org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.addLogConfig(LoggerSpecificEncoder.java:72)
        at      at org.apache.sling.commons.log.logback.internal.LogConfigManager.onResetComplete(LogConfigManager.java:290)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.fireResetCompleteListeners(LogbackManager.java:268)
        at      at org.apache.sling.commons.log.logback.internal.OsgiInternalAction$ConfigCompleteListener.inPlay(OsgiInternalAction.java:158)
        at      at ch.qos.logback.core.joran.spi.InterpretationContext.fireInPlay(InterpretationContext.java:183)
        at      at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:61)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
        at      at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager$DefaultCallback.perform(LogbackManager.java:604)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:325)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:305)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager.access$300(LogbackManager.java:51)
        at      at org.apache.sling.commons.log.logback.internal.LogbackManager$1.run(LogbackManager.java:252)
        at      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at      at java.lang.Thread.run(Thread.java:745)
11:36:41,459 |-WARN in org.apache.sling.commons.log.logback.internal.LogbackManager@47befe3d - No previous configuration to fall back on.
rombert commented 10 years ago

This issue was caused by a bug in the Sling IDE Tooling project ( see SLING-4041: Escaped braces at the start of a property value are not unescaped ) and will be incorporated in the next AEM Developer Tools public release. As such, there is nothing to fix in the archetype.

If you'd like to build a fix yourself, please follow the instructions from Sling IDE Tooling - building from source.