I'm not aware of a single method that will always work regardless of application type. I can't even see how that might work. A web app is very different from a Swing app, which is very different from a command line app, which is light-years from an Android app. The mechanisms are pretty application type specific.<div>
(*Chris*)<br><br><div class="gmail_quote">On Fri, Oct 21, 2011 at 2:03 PM, BAKHTI Mohammed <span dir="ltr"><<a href="mailto:onlymed@hotmail.com">onlymed@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div dir="ltr">
<br>Hello David, sorry about it, <br><br>My question is in general : as i do a code based configuration using Joran configurator : if i have some frameworks in my applications (a webapp or a jar ....) . those frameworks will init before my api, so they will send some logs to stdout or whatever. <br>
<br>My goal : is how can i be sure that my api (which use logback ) is always initialized firt before all the other. <br><br>is that possible ? <br><br>If i use a logback.xml i see that logback is always the firt launched. so how can i do the same <br>
<br>Thanks <br><div><hr>CC: <a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>From: <a href="mailto:nabble@diroussel.xsmail.com" target="_blank">nabble@diroussel.xsmail.com</a><br>Date: Fri, 21 Oct 2011 21:15:45 +0100<div class="im">
<br>To: <a href="mailto:logback-user@qos.ch" target="_blank">logback-user@qos.ch</a><br>Subject: Re: [logback-user] How to start my logback before anything in an application<br><br>
</div><div><div></div><div class="h5"><div>And if it's a command line tool, just initialise log back manually before you create any loggers. </div><div><br></div><div>(Mohammed: please create a new email for a new thread. Don't just reply to an existing thread and change the subject, most email software treats it as the same thread.)<br>
<br>David</div><div><br>On 21 Oct 2011, at 17:57, Chris Pratt <<a href="mailto:thechrispratt@gmail.com" target="_blank">thechrispratt@gmail.com</a>> wrote:<br><br></div><div></div><blockquote><div>I assume you're talking about a Web Application. If so, check out <a href="http://download.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html" target="_blank">javax.servlet.ServletContextListener</a>, it's your best bet.<div>
(*Chris*)<br><br><div>On Fri, Oct 21, 2011 at 7:47 AM, BAKHTI Mohammed <span dir="ltr"><<a href="mailto:onlymed@hotmail.com" target="_blank">onlymed@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">
<div><div dir="ltr">
Hello, <br><br>I have actually an API which use logback and add some specific functions. this API initialize logback in code : joranConfigurator(myconfig.file) <br><br>I dont have any logback.xml in my classpath.<br><br>
My question is how can i start this API (and then logback) at application startup before all the other frameworks and APIs (spring, hibernate, axis...) <br><br>I mean the same way logback init itself with logback.xml at startup<br>
<br>Thanks<br> </div></div>
<br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br></blockquote></div><br></div>
</div></blockquote><blockquote><div><span>_______________________________________________</span><br><span>Logback-user mailing list</span><br><span><a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a></span><br>
<span><a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a></span></div></blockquote><br>_______________________________________________
Logback-user mailing list
<a href="mailto:Logback-user@qos.ch" target="_blank">Logback-user@qos.ch</a>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a></div></div></div> </div></div>
<br>_______________________________________________<br>
Logback-user mailing list<br>
<a href="mailto:Logback-user@qos.ch">Logback-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/logback-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/logback-user</a><br></blockquote></div><br></div>