hi guys,<br><br>I try to configure logback for our application in glassfish (3.1) as follows:<br><br>[*] I start gf with -Dlogback.configurationFile=/path/to/file<br><br>[*] logback.xml is:<br><i><configuration><br><!--<br>
<insertFromJNDI env-entry-name="java:app/AppName" as="appName" /><br> <contextName>${appName}</contextName><br>--><br> <appender name="FILE" class="ch.qos.logback.core.FileAppender"><br>
<file>../logs/r6.log</file><br> <encoder><br> <pattern>%date %-5p [%thread] [%contextName] [%logger{20}] %msg%n</pattern><br> </encoder><br> </appender><br> <root level="debug"><br>
<appender-ref ref="FILE" /><br> </root><br></configuration><br></i><br>So far everything works fine. However I encountered a problem in the following situation.<br><br>[*] A simple message driven bean, which is invoked if there are new messages in a given "jms-queue" like this:<i><br>
@MessageDriven( mappedName="myQueue", activationConfig = {<br> @ActivationConfigProperty(propertyName = "acknowledgeMode",<br> propertyValue = "Auto-acknowledge"),<br>
@ActivationConfigProperty(propertyName = "destinationType",<br> propertyValue = "javax.jms.Queue")<br>})<br>public class MyMdb implements MessageListener {<br><br> private static Logger logger = LoggerFactory.getLogger(MyMdb.class);<br>
<br> @Override<br> public void onMessage(Message msg) {<br> <a href="http://logger.info">logger.info</a>("got message...");<br> }<br>}</i><br><br>[*] Glassfish is not running, AND there ARE messages in the queue<br>
[*] Now when I start glassfish the application (MyMdb) start receiving the messages from the queue<br>[*] At this point logback is not yet initialized, as I see the following messages in my logfile:<br><br><i>The following loggers will not work becasue they were created during the default configuration phase of the underlying logging system. See also <a href="http://www.slf4j.org/codes.html#substituteLogger">http://www.slf4j.org/codes.html#substituteLogger</a></i><br>
<br>Any ideas how to solve this?<br><br>tia,<br>daniel<br>