- 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
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
>>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
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
> 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]
- 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
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]
- 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
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
> 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
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
> 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;
> 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
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
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
> 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
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
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
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
19 matches
Mail list logo