jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf Kintrup" <r.kint...@inovex.de>
Subject Re: server side logging problem with SilverStream AppServer
Date Mon, 12 Nov 2001 06:39:05 GMT
Hi Vincent,

> > I think it would be a good idea though to take the fixed property file
> name
> > out of the Redirector classes and have them configurable in web.xml or
> > alternatively use getServletContext().getResource() on the HTTP Request
to
> > get the property file. Then I could access it.
> >
>
> Yes, that might be a good idea ... but .... I haven't done that because I
> wanted to bundle the properties files in cactus.jar so that it would be
> easier for cactus users, especially those who don't care about logs.
Cactus
> logs should be something internal. The problem at the current time is that
> it interferes with your own application logs (if you're also using log4j).
> I'd like to find a way to configure log4j so that it is possible to use
> several "instances" of it, not interfering with one another even in the
same
> jvm. I'm quite sure it is possible but haven't looked into how to do it
yet.

I think you are right about handling Cactus logging as something internal.
Checking if Log4J is in the classpath is a fine switch to enable logging
too. If someone uses Log4J for his application he is probably also
interested in stearing logging output of other packages.
I wouldn't like to have more instances of Log4J though! That would require
another special method or way to configure those instances. Distinguishing
logging behaviour by package structure is enough separation. Log4J users
should always be able to handle all configuration in just one log file. If
you use Servlets and EJBs this is not the case today. You need to set up an
instance of Log4J for the web container and one for the EJB container since
they have separate address spaces. This is necessary but not very nice.

Ralf

----- Original Message -----
From: "Vincent Massol" <vmassol@octo.com>
To: <cactus-user@jakarta.apache.org>
Sent: Friday, November 09, 2001 9:03 PM
Subject: Re: server side logging problem with SilverStream AppServer


>
>
> ----- Original Message -----
> From: "Ralf Kintrup" <r.kintrup@inovex.de>
> To: "Cactus Users List" <cactus-user@jakarta.apache.org>; "Vincent Massol"
> <vmassol@octo.com>
> Sent: Friday, November 09, 2001 2:08 PM
> Subject: Re: server side logging problem with SilverStream AppServer
>
>
> > Hi Vincent,
> >
> > > Is log_server.properties available in cactus.jar ?
> >
> > Yes.
> >
> >
> > >And is cactus.jar in your web-inf/lib directory ?
> >
> > Yes.
> >
> >
> > > Could you post the exact stack trace you're getting
> > > along with your war file structure ? I have never used silverstream;
it
> > does
> > > support war, right ?
> >
> > SilverStream does support WAR files. There is no exception and no stack
> > trace. Cactus just prints out the error message "[warning] Failed to
> > configure...".
> >
> > I looked into Cactus LogService.java class. In the init() method Cactus
> does
> > find the log4j-core.jar in the classpath but then fails to get the file
> with
> > this.getClass().getResource(). This seems to be a SilverStream class
> loader
> > problem. SilverStream stores all contents in a database and therefore
uses
> > its own class loader to get the necessary resources. Here it failes to
> find
> > the resource in cactus.jar and it failes to find it in WEB-INF/classes
> too.
> > I will mail this problem to SilverStream.
>
> I think you're right.
>
> >
> > LogService.java snippet:
> >
> >     public void init(String theFileName)
> >     {
> >         // If logging system already initialized, do nothing
> >         if (isInitialized()) {
> >             return;
> >         }
> >
> >         if (theFileName != null) {
> >
> >             if (this.isLog4jInClasspath) {
> >
> >                 URL url = this.getClass().getResource(theFileName);
> >                 if (url != null) {
> >                     // Initialize Log4j
> >                     PropertyConfigurator.configure(url);
> >                 } else {
> >                     // Failed to configure logging system, simply print
> >                     // a warning on stderr
> >                     System.err.println("[warning] Failed to configure "
+
> >                         "logging system : Could not find file [" +
> >                         theFileName + "]");
> >                 }
> >
> >             }
> >
> >         }
> >         this.isInitialized = true;
> >     }
> >
> >
> > I think it would be a good idea though to take the fixed property file
> name
> > out of the Redirector classes and have them configurable in web.xml or
> > alternatively use getServletContext().getResource() on the HTTP Request
to
> > get the property file. Then I could access it.
> >
>
> Yes, that might be a good idea ... but .... I haven't done that because I
> wanted to bundle the properties files in cactus.jar so that it would be
> easier for cactus users, especially those who don't care about logs.
Cactus
> logs should be something internal. The problem at the current time is that
> it interferes with your own application logs (if you're also using log4j).
> I'd like to find a way to configure log4j so that it is possible to use
> several "instances" of it, not interfering with one another even in the
same
> jvm. I'm quite sure it is possible but haven't looked into how to do it
yet.
>
> What do you think ?
> Thanks
> -Vincent
>
> > Ralf
> >
> >
> > ----- Original Message -----
> > From: "Vincent Massol" <vmassol@octo.com>
> > To: "Cactus Users List" <cactus-user@jakarta.apache.org>
> > Sent: Thursday, November 08, 2001 11:05 PM
> > Subject: Re: server side logging problem with SilverStream AppServer
> >
> >
> > > Hi Ralf,
> > >
> > > ----- Original Message -----
> > > From: "Ralf Kintrup" <r.kintrup@inovex.de>
> > > To: <cactus-user@jakarta.apache.org>
> > > Sent: Wednesday, November 07, 2001 3:05 PM
> > > Subject: server side logging problem with SilverStream AppServer
> > >
> > >
> > > > Hi,
> > > >
> > > > I am trying to get Cactus to log information with the SilverStream
> > > AppServer
> > > > on the server side. Cactus does find Log4J in the classpath but then
> > fails
> > > > to load the file '/log_server.properties'. I neither finds it in
> > > > 'cactus.jar' nor in 'WEB-INF/classes'. Does anyone know where to put
> the
> > > > 'log_server.properties' for SilverStream?
> > > >
> > >
> > > This is really strange and does not make sense to me. Is
> > > log_server.properties available in cactus.jar ? And is cactus.jar in
> your
> > > web-inf/lib directory ? Could you post the exact stack trace you're
> > getting
> > > along with your war file structure ? I have never used silverstream;
it
> > does
> > > support war, right ?
> > >
> > > > I am using:
> > > > cactus v1.2
> > > > log4j v1.1.2
> > > > SilverStream v3.7.3
> > > >
> > > > Ralf
> > > >
> > >
> > > -Vincent
> > >
> >
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:cactus-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:cactus-user-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message