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

logback initialization does not initialize correct loggers if there's a single false one

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Commons Log 4.0.4
    • Component/s: Commons
    • Labels:
      None

      Description

      If you configure a logger wrongly, which eg results in this stacktrace:

      2014-02-28 11:59:17  ERROR  LogbackManager  Error occurred while configuring Logback
      
      java.lang.IllegalArgumentException: Cannot format given Object as a Date
       at java.text.DateFormat.format(DateFormat.java:281)
       at java.text.Format.format(Format.java:140)
       at java.text.MessageFormat.subformat(MessageFormat.java:1288)
       at java.text.MessageFormat.format(MessageFormat.java:836)
       at java.text.Format.format(Format.java:140)
       at java.text.MessageFormat.format(MessageFormat.java:812)
       at org.apache.sling.commons.log.logback.internal.LogConfig.createLayout(LogConfig.java:124)
       at org.apache.sling.commons.log.logback.internal.util.LoggerSpecificEncoder.addLogConfig(LoggerSpecificEncoder.java:72)
       at org.apache.sling.commons.log.logback.internal.LogConfigManager.onResetComplete(LogConfigManager.java:283)
       at org.apache.sling.commons.log.logback.internal.LogbackManager.fireResetCompleteListeners(LogbackManager.java:266)
       at org.apache.sling.commons.log.logback.internal.OsgiInternalAction$ConfigCompleteListener.inPlay(OsgiInternalAction.java:158)
       at ch.qos.logback.core.joran.spi.InterpretationContext.fireInPlay(InterpretationContext.java:183)
       at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:61)
       at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:149)
       at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:135)
       at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:99)
       at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:49)
       at org.apache.sling.commons.log.logback.internal.LogbackManager$DefaultCallback.perform(LogbackManager.java:574)
       at org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:322)
       at org.apache.sling.commons.log.logback.internal.LogbackManager.configure(LogbackManager.java:303)
       at org.apache.sling.commons.log.logback.internal.LogbackManager.access$200(LogbackManager.java:51)
       at org.apache.sling.commons.log.logback.internal.LogbackManager$1.run(LogbackManager.java:251)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
       at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
       at java.util.concurrent.FutureTask.run(FutureTask.java:138)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
       at java.lang.Thread.run(Thread.java:695)
      
      

      logback initialization stops completely and no other logger will be honored.

      I think the logback initialization should continue and just mark the failing one prominently, instead of completely stopping.

        Attachments

          Activity

            People

            • Assignee:
              chetanm Chetan Mehrotra
              Reporter:
              stefanegli Stefan Egli
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: