Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-112

classloader for loading autoConfig configuration resource

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • None
    • None
    • logback-core
    • None
    • Operating System: Windows
      Platform: PC

    • 68

    Description

      ContextInitializer.autoConfig(LoggerContext) uses current thread context ClassLoader (TCL) nowadays - it calls Thread.currentThread().getContextClassLoader(). Sometimes this classloader has no access to logback classes - for example TCL is parent of classloader, which loaded current class, in oc4j (Oracle J2EE container) at the time of starting servlet container. So logback-*.jar are in WEB-INF/lib directory, but TCL has no access to these jars and to files in WEB-INF/classes.

      I think ContextInitializer.autoConfig(LoggerContext) should try this.getClass().getClassLoader() first and only if it fails it should use Thread.currentThread().getContextClassLoader().

      Attachments

        Activity

          People

            logback-dev Logback dev list
            Filip.Jirsak Filip Jirsák
            Votes:
            9 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated: