I use logback (via slf4j) in a Java applet with configuration stored in logback.xml file in the applet root directory. Running in Eclipse it can find and load config placed somewhere in classpath. But it doesn’t load configuration from applet jar.
I suspect this issue is not related with logback but with applet itself. I have no experience with applets at all.
[EDIT]
logback.xml (logging configuration file) is in the root directory of the jar, the rest of jar content seems is not relevant. It’s the typical location of logging configuration file in jar files so the issue is not related with the file location. I checked the jar file. Actually I have 2 jar files: server side and applet (client side). Logging configuration works fine on server side, so I suspect it’s something related with applet specifics.
[EDIT2]
I don’t load logging configuration explicitly, it’s done by logback library, it looks for specific file name in classpath.
[EDIT3]
Applet setup:
<applet name="name" id="game" width="100%" height="100%" alt="Please visit our site"
archive="my.jar" code="path/to/main.class" mayscript="" title="Java">
<param name="boxborder" value="false">
<param name="separate_jvm" value="true">
<param name="image" value="http://www.oursite.com/img/splash.gif">
<param name="centerimage" value="true">
<param name="boxbgcolor" value="black">
<param name="java_arguments" value="-Xmx384m -Dsun.java2d.noddraw=true -XX:CompileThreshold=1500 -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -Dcom.sun.management.jmxremote -Xss6m">
<div class="nojava">
<h1>
Please Update Java</h1>
<p>
It appears that you do not have Java installed, or your version of Java is out of
date. To play this game for free please <a target="_blank" href="http://www.java.com/en/download/index.jsp">
click here</a> to download the latest version of Java. </p>
</div>
</applet>
[EDIT4]
Printed logback’s internal diagnostic info, it says it cannot find logback.xml
resolved
The problem wasn’t related with logback or applet. I was putting configuration file into the jar after it was already signed. Thanks everybody for your help.