Controlling logback environment dependent properties in external application properties file
<p>In my <code>spring-boot</code> application I use <code>logback</code> for logging.  The application uses external <code>application.properties</code> file for setting environment specific application properties and starts with option: <code>-spring.config.location=path/to/file</code>. I would like logback configuration to read properties from there as well so that all environment properties are managed in one place. </p>

<p>I tried the approach described <a href="https://stackoverflow.com/questions/40497947/how-to-pass-properties-from-application-properties-to-logback-config-file">here</a>, but since the properties file is not on the classpath, I get the error:</p>

<pre><code>java.lang.IllegalStateException: Logback configuration error detected: 
ERROR in ch.qos.logback.core.joran.action.PropertyAction - Could not find resource [application.properties]
</code></pre>

<p>Is there something I am missing?</p>

<p>UPDATE:</p>

<p>Adding this configuration works:</p>

<pre><code>   &lt;property file="path/to/file" /&gt;
</code></pre>

<p>But I would like to avoid hardcoding the file path.</p>