> -----Original Message-----
> From: Gareth Morgan [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 10:56 AM
> To:   [EMAIL PROTECTED]
> Subject:      Log4j and Appservers (Weblogic)
> 
> I've seen in the archives that a few people have used log4j with an
> appserver successfully.
> 
> Is this because some appservers are very relaxed about enforcing the
> standards on classes used by EJBs? I'm really thinking of  the
> synchronization that log4j does, which shouldn't really be 'allowed'
> when called from an EJB.
        [Kitching Simon]  
        Do you mean that EJBs are not allowed to synchronise on locks?
        I suppose that you could be right there - there is theoretically a
        possibility that the code might block forever (ie the lock is
        never released by the owner) but in *practice* I can't see a
problem.

        From what I've seen, log4j is generally pretty careful with locks,
        trying to avoid them where possible.

        Do you have a concrete example where a problem might occur? Or
        do you have an example of an EJB container which refuses to allow
        log4j to run? I can't see any practical way in which an EJB
container 
        could enforce a no-synchronisation restriction..

> Also, I'm concerned that the single hierarchy of categories wouldn't be
> a singleton any more if the appserver started using multiple JVMs (for
> example when clustering), as non final statics aren't really allowed in
> EJB land either. Anyone tried log4j on a cluster?
        [Kitching Simon]  
        Clearly, if multiple JVMs are used (or even multiple class-loaders)
then
        there will be multiple copies of the hierarchy/categories, etc, but
I don't 
        really see a problem here, except for the case of FileAppender. 

        FileAppender doesn't attempt to handle the case where multiple 
        processes are writing to a single file; java doesn't have
inter-process 
        semaphores (and even those won't do the job if the app is
distributed 
        across machines). I think that in clustered environments, you just 
        go to a non-FileAppender class like JMSAppender, SocketAppender, 
        SyslogAppender, or DatagramStringAppender, no???

        Or, an appender could be written which forwards logged messages
        to the EJB container's logging API (eg WebLogicAppender, 
        WebSphereAppender..). Hmm..this approach would allow use of 
        log4j's nice config, filtering, categories, etc. while leaving the
EJB 
        container to actually store the messages [[ comments, anyone?? ]]
        Appenders are quite easy to write...

> (I'm refering to section 18.1.2 of the EJB spec, version 1.1 for these
> limitations)
> 
> Thanks for any advice
>       Gareth
> 
        [Kitching Simon]  
        I'd be interested in your progress with this..

        Regards,

        Simon
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35 
> a year!  http://personal.mail.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to