Re: PropertyConfigurator.configure method in J2EE

2001-10-14 Thread Stefano Mancarella
- Original Message - From: "Ceki Gülcü" <[EMAIL PROTECTED]> Subject: Re: PropertyConfigurator.configure method in J2EE > > > Does log4j default initialization ring a bell? > > AFAIK, default initialization can't be used with JBoss. > Hmmm, you are r

RE: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Ceki Gülcü
At 14:28 12.10.2001 -0700, you wrote: >>>No offense but the LogFactory code you suggested is crap. I am sure >>>you see the reasons for yourself. Please refrain from suggesting it >>>to other log4j users. Regards, Ceki > >Why is this "crap"? It is not obvious to me. We have a similar static >in

RE: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Mark Womack
>>No offense but the LogFactory code you suggested is crap. I am sure >>you see the reasons for yourself. Please refrain from suggesting it >>to other log4j users. Regards, Ceki Why is this "crap"? It is not obvious to me. We have a similar static initializer and access methods in the log4j wr

Re: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Ceki Gülcü
At 18:23 12.10.2001 +0200, you wrote: >> Does log4j default initialization ring a bell? > >AFAIK, default initialization can't be used with JBoss. Stefano, Hmmm, you are right. I am writing a section on this in the new log4j manual. I'll post it when it's in presentable form. No offense but th

Re: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Stefano Mancarella
> Does log4j default initialization ring a bell? AFAIK, default initialization can't be used with JBoss. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Mitchell Ackermann
- Original Message - From: "Michael Mason" <[EMAIL PROTECTED]> > I have a better solution... > Now configuration happens when the JVM loads the LoggerFactory class > and this is guaranteed to happen only once. Which is basically exactly the same as Category already does it. This will ba

Re: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Ceki Gulcu
Does log4j default initialization ring a bell? Avoid reeinventing the wheel especially if yours happens to be sqaure. Regards, Ceki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Stefano Mancarella
- Original Message - From: "Michael Mason" <[EMAIL PROTECTED]> > This isn't thread-safe, because if two threads call getInstance() > at the same time, your configure code could run twice. You're right. > A slightly > better solution would be to use synchronized to make sure it's > thre

RE: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Thomas Tuft Muller
List' | Subject: RE: PropertyConfigurator.configure method in J2EE | | | > In case you didn't know: The double-checked locking pattern originally | > proposed by Douglas C. Schmidt is proven inherently unsafe in Java. | > | > See | > http://www.cs.umd.edu/~pugh/java/me

RE: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Michael Mason
> In case you didn't know: The double-checked locking pattern originally > proposed by Douglas C. Schmidt is proven inherently unsafe in Java. > > See > http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html. I've heard about this one, thanks for bringing it up. This probably is

RE: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Thomas Tuft Muller
ailto:[EMAIL PROTECTED]] | Sent: 12 October 2001 15:04 | To: 'LOG4J Users Mailing List' | Subject: RE: PropertyConfigurator.configure method in J2EE | | | > import org.apache.tools.log4j.Category; | > | > public class LoggerFactory { | > | > private sta

RE: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Michael Mason
> import org.apache.tools.log4j.Category; > > public class LoggerFactory { > > private static boolean configured = false; > > private static void configure() { > if (!configured) { > /*** Place all your configuration stuff here. ***/ > configured = true;

Re: PropertyConfigurator.configure method in J2EE

2001-10-12 Thread Stefano Mancarella
> So, when using a J2EE server, where is the appropriate place for putting > the configure call? If think I've found a simple solution which works fine with all EJB containers, without using servlets or JSPs and, AFAIK, without violating the specs. It also works if different JVMs are forked. I've

RE: PropertyConfigurator.configure method in J2EE

2001-10-11 Thread Ceki Gülcü
At 11:01 11.10.2001 -0400, David Schultz wrote: >Using a JSP to configure the properties would only work if the Web Container >and the EJB Container are the SAME Java Virtual Machine (otherwise they >wouldn't be sharing statics). This seems like a bad assumption to me. > >Orion does support loadi

RE: PropertyConfigurator.configure method in J2EE

2001-10-11 Thread David Schultz
Using a JSP to configure the properties would only work if the Web Container and the EJB Container are the SAME Java Virtual Machine (otherwise they wouldn't be sharing statics). This seems like a bad assumption to me. Orion does support loading an EJB at startup (in the server.xml file). This

RE: PropertyConfigurator.configure method in J2EE

2001-10-10 Thread Michael Mason
> Maybe this all points to only being able to use Log4J in a > very specific way > inside J2EE (or maybe it just means I missed something > terribly important at > a very basic level). In any event, I think some clarification will be > useful to all. I think the bottom line may be "try it and

RE: PropertyConfigurator.configure method in J2EE

2001-10-10 Thread David Schultz
nk some clarification will be useful to all. Dave -Original Message- From: Ceki Gülcü [mailto:[EMAIL PROTECTED]] Sent: Tuesday, 02.October 2001 02:50 To: LOG4J Users Mailing List Subject: Re: PropertyConfigurator.configure method in J2EE At 16:08 01.10.2001 -0400, David Schultz wrote: >If

Re: PropertyConfigurator.configure method in J2EE

2001-10-01 Thread Ceki Gülcü
At 16:08 01.10.2001 -0400, David Schultz wrote: >If I understand the documentation and discussion threads properly, the >configure method of the PropertyConfigurator class should only be called >once be JVM. (Multiple calls result in multiple occurences of output data >in the logs.) That is not

Re: PropertyConfigurator.configure method in J2EE

2001-10-01 Thread Eddie
Define a init servlet/jsp as "load-on-startup" (see the web.xml spec) per J2EE application. Use the init servlet to configure the log properties. If another application does the same thing.., Swauu... it doesn't matter. At least in this way you are sure that all the applications are independent