[logback-dev] [JIRA] Updates for LOGBACK-1706: insertFromJNDI does not work in 1.4.4

QOS.CH (JIRA) noreply-jira at qos.ch
Fri Nov 18 11:18:00 CET 2022


logback / LOGBACK-1706 [Open]
insertFromJNDI does not work in 1.4.4

==============================

Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.

View or comment on issue using this link
https://jira.qos.ch/browse/LOGBACK-1706

==============================
 Issue created
------------------------------

Ove Hiltwein created this issue on 18/Nov/22 11:07 AM
Summary:              insertFromJNDI does not work in 1.4.4
Issue Type:           Bug
Affects Versions:     1.4.4
Assignee:             Logback dev list
Components:           logback-classic
Created:              18/Nov/22 11:07 AM
Environment:
  Linux,
  
  Tomcat 10.0.23
Priority:             Major
Reporter:             Ove Hiltwein
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 at 1390cc4c - Can't handle model of type class ch.qos.logback.core.model.InsertFromJNDIModel with tag: insertFromJNDI at line 5


==============================
 This message was sent by Atlassian Jira (v8.8.0#808000-sha1:e2c7e59)



More information about the logback-dev mailing list