[logback-user] How to start my logback before anything in an application
Chris Pratt
thechrispratt at gmail.com
Fri Oct 21 23:50:22 CEST 2011
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.
(*Chris*)
On Fri, Oct 21, 2011 at 2:03 PM, BAKHTI Mohammed <onlymed at hotmail.com>wrote:
>
> Hello David, sorry about it,
>
> 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.
>
> My goal : is how can i be sure that my api (which use logback ) is always
> initialized firt before all the other.
>
> is that possible ?
>
> If i use a logback.xml i see that logback is always the firt launched. so
> how can i do the same
>
> Thanks
> ------------------------------
> CC: logback-user at qos.ch
> From: nabble at diroussel.xsmail.com
> Date: Fri, 21 Oct 2011 21:15:45 +0100
>
> To: logback-user at qos.ch
> Subject: Re: [logback-user] How to start my logback before anything in an
> application
>
> And if it's a command line tool, just initialise log back manually before
> you create any loggers.
>
> (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.)
>
> David
>
> On 21 Oct 2011, at 17:57, Chris Pratt <thechrispratt at gmail.com> wrote:
>
> I assume you're talking about a Web Application. If so, check out
> javax.servlet.ServletContextListener<http://download.oracle.com/javaee/6/api/javax/servlet/ServletContextListener.html>,
> it's your best bet.
> (*Chris*)
>
> On Fri, Oct 21, 2011 at 7:47 AM, BAKHTI Mohammed <onlymed at hotmail.com>wrote:
>
> Hello,
>
> I have actually an API which use logback and add some specific functions.
> this API initialize logback in code : joranConfigurator(myconfig.file)
>
> I dont have any logback.xml in my classpath.
>
> 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...)
>
> I mean the same way logback init itself with logback.xml at startup
>
> Thanks
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
>
> _______________________________________________ Logback-user mailing list
> Logback-user at qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
>
> _______________________________________________
> Logback-user mailing list
> Logback-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20111021/fa93336a/attachment.html>
More information about the Logback-user
mailing list