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

insertFromJNDI does not work in 1.4.4

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.3.5, 1.4.5
    • 1.4.4
    • logback-classic
    • None
    • Linux,

      Tomcat 10.0.23

    Description

      For our web application (tomcat 10.0.23) using logback-classic in versin 1.2.11, we define the log file name with the insertFromJNDI option as described in the documentation:
      in the logback config file:
      <insertFromJNDI env-entry-name="java:comp/env/loggingContextName" as="loggingContextName" />
      <contextName>${loggingContextName}</contextName>

      <appender name="ERRORFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
      <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>${logDir}/${loggingContextName}error%d{yyyy-MM-dd}.log
      </fileNamePattern>
      <maxHistory>7</maxHistory>
      </rollingPolicy>
      <encoder>
      <pattern>%d{ISO8601} %5p [%X\{session}] [%c]: %m%n</pattern>
      </encoder>
      <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>WARN</level>
      </filter>
      </appender>

      The environment entry is defined in the web.xml:
      <env-entry>
      <env-entry-name>loggingContextName</env-entry-name>
      <env-entry-type>java.lang.String</env-entry-type>
      <env-entry-value>server_v4</env-entry-value>
      </env-entry>

      This works nicely and as epxected.

      However, after upgrading to logback-classic version 1.4.4, the corresponding log information is written to a file loggingContextName_IS_UNDEFINED_error_<date>.log, and tomcat prints the following to the console during startup:
      -ERROR in ch.qos.logback.core.model.processor.DefaultProcessor@1390cc4c - Can't handle model of type class ch.qos.logback.core.model.InsertFromJNDIModel with tag: insertFromJNDI at line 5

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            ohitwein Ove Hiltwein
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: