<html><head></head><body><div class="yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div dir="ltr" data-setdir="false">Hi, sorry if this is a noob question. I really searched but could not find a way.</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I have a war-packaged application. I have configured logback to get an variable from JNDI with "<span>insertFromJNDI" and placed the definition of that variable in a tomcat context XML. All of this works just fine when I deploy the application the way I want.</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span>Now, when running the application for tests or development, I would like to be able to have a default value for this variable. I can work with the :- operator when I define the log file name, but the problem I am having is that the missing JNDI parameter is causing an error and an abort of the application startup. The error shows:</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><div>java.lang.IllegalStateException: Logback configuration error detected: <br>ERROR in ch.qos.logback.classic.joran.action.InsertFromJNDIAction - [java:comp/env/instanceName] has null or empty value</div><div><br></div><div dir="ltr" data-setdir="false">This happens with Eclipse and a Tomcat server managed by the IDE and on a Spring Boot embedded tomcat as well. I imagine many might reply suggesting ways to define the JNDI parameter in those situations, something I am open too and would appreciate, but deep down my question is: should the missing parameter really be an error? shouldn't it just issue a warning at most and not throw the exception, leaving the variable undefined just like any other env variable to be used with ":-"? Is that something that can be configured by any chance?</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">Thanks!<br></div></div></div></body></html>