You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ceki Gülcü <ce...@qos.ch> on 2002/06/25 23:32:44 UTC

Re[4]: stopping logging after removing context in Tomcat prob lem...


I don't know if this relevant or correct but it seems to me that Tomcat
contexts have to be reloadable and crossContext. As in:

   <Context path="/xyz" docBase="xyz" debug="0" reloadable="true"
                               crossContext="true">

This is in the file conf/server.xml.

Hope this helps,

At 16:05 25.06.2002 -0500, you wrote:
>Hello Swami,
>
>Thanks for the info.
>
>I tried adding LogManager.shutdown() to my Log4jInit servlet's
>destroy() method, but it seems as if not all servlets are guaranteed to 
>have their
>destroy() method called.  What I saw in the Tomcat logs was that only
>servlets that were called via their doGet or doPost methods have their
>destroy methods called.  My Log4jInit servlet which gets run at
>context startup (via an entry in the web.xml) never had its destroy method 
>called even though it was
>initialized.
>
>Looks like I'll have to write a ServletContextListener or something.
>
>Jake
>
>Tuesday, June 25, 2002, 2:45:55 PM, you wrote:
>
>SI> I think there is a LogManager.shutdown().
>
>SI> Swami
>
> >> -----Original Message-----
> >> From: Jacob Kjome [mailto:hoju@visi.com]
> >> Sent: June 25, 2002 3:40 PM
> >> To: Log4J Users List
> >> Subject: Re[2]: stopping logging after removing context in Tomcat
> >> problem...
> >>
> >>
> >> Hello Swami,
> >>
> >> That sounds good.  Can you expand on how I would do a
> >> "log4j.shutdown"?  I'm not sure where to look.  I've never seen
> >> mention of this in the FAQ or the docs and don't know where to look in
> >> the API for this.  If you can point me in the right direction, that
> >> would be excellent!
> >>
> >> thanks,
> >>
> >> Jake
> >>
> >> Tuesday, June 25, 2002, 1:53:41 PM, you wrote:
> >>
> >> SI> Try catching the deploy in the destroy of the servlet and do the
> >> SI> log4j.shutdown. This would release the resource held by
> >> this jar file and
> >> SI> you would be able to perform your operation.
> >>
> >> SI> Swami
> >>
> >> >> -----Original Message-----
> >> >> From: Jacob Kjome [mailto:hoju@visi.com]
> >> >> Sent: June 25, 2002 2:47 PM
> >> >> To: Log4J Users List
> >> >> Subject: stopping logging after removing context in Tomcat
> >> problem...
> >> >>
> >> >>
> >> >> Hi,
> >> >>
> >> >> I'm not sure if this is an issue I should be bringing up here or on
> >> >> the Tomcat-user list, but here goes...
> >> >>
> >> >> I am using Tomcat-4.1.3 and taking advantage of the new Ant tasks
> >> >> which hook up to Tomcat's manager app to dynamically install and
> >> >> remove applications.  This works great and log4j initializes just
> >> >> fine.  I am using the FileAppender with
> >> configureAndWatch().  Logging
> >> >> works just fine.
> >> >>
> >> >> However, when I remove the app, Tomcat seems to unload all
> >> resources
> >> >> except for log4j-1.2.4.jar because when I attempt an "ant clean",
> >> >> which deletes my "build" directory, it fails saying that
> >> the resource
> >> >> log4j-1.2.4.jar is still in use.
> >> >>
> >> >> So, is this an issue that someone here can explain or should I take
> >> >> this up with the Tomcat-user list?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Jake
> >> >>
> >> >>
> >> >>
> >> >> --
> >> >> Best regards,
> >> >>  Jacob                          mailto:hoju@visi.com
> >> >>
> >> >>
> >> >> --
> >> >> To unsubscribe, e-mail:
> >> SI> <ma...@jakarta.apache.org>
> >> SI> For additional commands, e-mail:
>SI> <ma...@jakarta.apache.org>
>
>SI>> --
>SI>> To unsubscribe, e-mail:
>SI> <ma...@jakarta.apache.org>
>SI>> For additional commands, e-mail:
>SI> <ma...@jakarta.apache.org>
>
>
>
>
>
>
>--
>Best regards,
>  Jacob                            mailto:hoju@visi.com
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>

--
Ceki


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[5]: stopping logging after removing context in Tomcat prob lem...

Posted by Jacob Kjome <ho...@visi.com>.
Hello Ceki,

I created a ServletContextListener and can now successfully call
LogManager.shutdown() at context shutdown.  The Javadoc doesn't have much to say about
this method.  What exactly does it shut down because the Log4j jar file is still
reported as a being in use so my ant "clean" target fails since it
can't delete the log4j jar???

Jake


Tuesday, June 25, 2002, 4:32:44 PM, you wrote:



CG> I don't know if this relevant or correct but it seems to me that Tomcat
CG> contexts have to be reloadable and crossContext. As in:

CG>    <Context path="/xyz" docBase="xyz" debug="0" reloadable="true"
CG>                                crossContext="true">

CG> This is in the file conf/server.xml.

CG> Hope this helps,

CG> At 16:05 25.06.2002 -0500, you wrote:
>>Hello Swami,
>>
>>Thanks for the info.
>>
>>I tried adding LogManager.shutdown() to my Log4jInit servlet's
>>destroy() method, but it seems as if not all servlets are guaranteed to 
>>have their
>>destroy() method called.  What I saw in the Tomcat logs was that only
>>servlets that were called via their doGet or doPost methods have their
>>destroy methods called.  My Log4jInit servlet which gets run at
>>context startup (via an entry in the web.xml) never had its destroy method 
>>called even though it was
>>initialized.
>>
>>Looks like I'll have to write a ServletContextListener or something.
>>
>>Jake
>>
>>Tuesday, June 25, 2002, 2:45:55 PM, you wrote:
>>
>>SI> I think there is a LogManager.shutdown().
>>
>>SI> Swami
>>
>> >> -----Original Message-----
>> >> From: Jacob Kjome [mailto:hoju@visi.com]
>> >> Sent: June 25, 2002 3:40 PM
>> >> To: Log4J Users List
>> >> Subject: Re[2]: stopping logging after removing context in Tomcat
>> >> problem...
>> >>
>> >>
>> >> Hello Swami,
>> >>
>> >> That sounds good.  Can you expand on how I would do a
>> >> "log4j.shutdown"?  I'm not sure where to look.  I've never seen
>> >> mention of this in the FAQ or the docs and don't know where to look in
>> >> the API for this.  If you can point me in the right direction, that
>> >> would be excellent!
>> >>
>> >> thanks,
>> >>
>> >> Jake
>> >>
>> >> Tuesday, June 25, 2002, 1:53:41 PM, you wrote:
>> >>
>> >> SI> Try catching the deploy in the destroy of the servlet and do the
>> >> SI> log4j.shutdown. This would release the resource held by
>> >> this jar file and
>> >> SI> you would be able to perform your operation.
>> >>
>> >> SI> Swami
>> >>
>> >> >> -----Original Message-----
>> >> >> From: Jacob Kjome [mailto:hoju@visi.com]
>> >> >> Sent: June 25, 2002 2:47 PM
>> >> >> To: Log4J Users List
>> >> >> Subject: stopping logging after removing context in Tomcat
>> >> problem...
>> >> >>
>> >> >>
>> >> >> Hi,
>> >> >>
>> >> >> I'm not sure if this is an issue I should be bringing up here or on
>> >> >> the Tomcat-user list, but here goes...
>> >> >>
>> >> >> I am using Tomcat-4.1.3 and taking advantage of the new Ant tasks
>> >> >> which hook up to Tomcat's manager app to dynamically install and
>> >> >> remove applications.  This works great and log4j initializes just
>> >> >> fine.  I am using the FileAppender with
>> >> configureAndWatch().  Logging
>> >> >> works just fine.
>> >> >>
>> >> >> However, when I remove the app, Tomcat seems to unload all
>> >> resources
>> >> >> except for log4j-1.2.4.jar because when I attempt an "ant clean",
>> >> >> which deletes my "build" directory, it fails saying that
>> >> the resource
>> >> >> log4j-1.2.4.jar is still in use.
>> >> >>
>> >> >> So, is this an issue that someone here can explain or should I take
>> >> >> this up with the Tomcat-user list?
>> >> >>
>> >> >> Thanks,
>> >> >>
>> >> >> Jake
>> >> >>
>> >> >>
>> >> >>
>> >> >> --
>> >> >> Best regards,
>> >> >>  Jacob                          mailto:hoju@visi.com
>> >> >>
>> >> >>
>> >> >> --
>> >> >> To unsubscribe, e-mail:
>> >> SI> <ma...@jakarta.apache.org>
>> >> SI> For additional commands, e-mail:
>>SI> <ma...@jakarta.apache.org>
>>
>>SI>> --
>>SI>> To unsubscribe, e-mail:
>>SI> <ma...@jakarta.apache.org>
>>SI>> For additional commands, e-mail:
>>SI> <ma...@jakarta.apache.org>
>>
>>
>>
>>
>>
>>
>>--
>>Best regards,
>>  Jacob                            mailto:hoju@visi.com
>>
>>
>>--
>>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>>For additional commands, e-mail: <ma...@jakarta.apache.org>

CG> --
CG> Ceki


CG> --
CG> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
CG> For additional commands, e-mail: <ma...@jakarta.apache.org>



-- 
Best regards,
 Jacob                            mailto:hoju@visi.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>