Executable jar not able to find logback.xml file
<p>I have standalone application which is bundled in executable <code>jar</code>. In MANIFEST file of executable <code>jar</code>, there is an entry for class-path where all dependent <code>jar</code> is listed (including all logback implementation jars ). This executable jar also contains <code>logback.xml</code> file.</p>
<p>With this structure, when I run my application with simple <code>java -jar MyApplication.jar</code> command, application runs fine with proper logging. But here main problem is, to change log level, one need to open jar file and I can't ask client to do that. So I placed <code>logback.xml</code> outside of jar but now all logging is happening on console.</p>
<p>I referred <a href="https://stackoverflow.com/questions/17440881/logback-cant-find-logback-xml-even-though-it-exists-on-the-classpath">Logback can&#39;t find logback.xml even though it exists (on the classpath)</a> and there solution mentioned is to bundle logback.xml inside a separate jar. But this solution is bad. That way client can't change log level easily. How to make it work with logback.xml outside of jar.</p>
<p>I tried adding <code>logback.xml</code> in MANIFEST Class-Path entry along with entry for other dependent jar, but didn't work. My application structure is like below</p>
<blockquote>
<p>+RootFolder<br />
--MyApplication.jar<br />
--logback-classic-1.1.3.jar<br />
--logback-core-1.1.3.jar<br />
--slf4j-api-1.7.7.jar<br />
--Other-Dependency.jar<br />
<strong>--logback.xml</strong></p>
</blockquote>
<p>Anyone has already solve this problem? I don't want to use programmatic configuration with Configurator.  Currently workaround is to use option <code>-Dlogback.configurationFile=logback.xml</code> But how to make it work with out ?</p>