Re: Initialization

Depending on your container, you can have startup class do your log4j initialization.. e.g., in WebLogic you can specify a (proprietary) startup class you want to have run via the console app.

It is also technically possible (although I have not done it personally) to extend the connector architecture (JCA) to bootstrap your log4j instances..

Re: File I/O

The EJB contract specifies that thou shalt not do file I/O from inside of beans directly (with out going thru a container managed service like a Connector/etc)... as beans may be suddenly passivated/etc...

That being said, I do it all the time in development w/ no issues . For production deployment it is easy enough to make a custom Appender that wraps the underlying logger mechanism that your container uses, and maps your log4j requests to the native logger.

Alternately, you can pick a Socket/JMS/DB appender, which uses a resource that is already managed by the container.

-Don


At 12:09 PM 11/19/2002 -0500, Follender, Ivan (HBO) wrote:
I want the properties easily accessible by the Application Server
administrator so they can dynamically modify the logging configuration.
This makes me want to have the log4j.properties outside of my deployed
EAR/JAR.

There still seems to be the problem of initialization, since for EJBs, there
is no good init() method for everything (unlike a servlet).

Thanks for the responses,
ivan.

-----Original Message-----
From: Jacob Kjome [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 19, 2002 12:01 PM
To: Log4J Users List
Subject: Re: Log4J in EJBs


Hello Ivan,

Well, you shouldn't use File IO in an EJB app because you can't
guarantee that the file can be read off the filesystem. For instance,
the file could be served out of a jar file. However as long as you
get an InputSream or URL of your properties or XML file, then you are
fine. That means you can store your config file in a jar archive or
in a JNDI directory or wherever you want. That said, I've not done
too much with EJB, but, in theory, there is no problem in reading your
config in EJB's.

Jake

Tuesday, November 19, 2002, 10:47:07 AM, you wrote:

FIH> Hi-

FIH> I want to use Log4J in my EJBs.
FIH> The guidance I've been getting is that EJBs should not access system
files
FIH> (e.g. log4j.properties).

FIH> Is there a recommended mechanism for configuring the LogFactory for
EJBs?

FIH> Thanks,
FIH> ivan.

FIH>
============================================================================
==
FIH> This e-mail is intended only for the use of the addressees. Any
copying, forwarding, printing or other use of this e-mail by persons other
than the addressees is not authorized. This e-mail
FIH> may contain information that is privileged, confidential and exempt
from disclosure. If you are not the intended recipient, please notify us
immediately by return e-mail (including the original
FIH> message in your reply) and then delete and discard all copies of the
e-mail. Thank you.




FIH> --
FIH> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
FIH> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>



--
Best regards,
Jacob mailto:[EMAIL PROTECTED]


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


==============================================================================
This e-mail is intended only for the use of the addressees. Any copying, forwarding, printing or other use of this e-mail by persons other than the addressees is not authorized. This e-mail may contain information that is privileged, confidential and exempt from disclosure. If you are not the intended recipient, please notify us immediately by return e-mail (including the original message in your reply) and then delete and discard all copies of the e-mail. Thank you.




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

+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
  donald h. larmee                               [EMAIL PROTECTED]
                                                                         804.301.UTOP
                         utopian software concepts, inc.
                                 www.utopiansoft.com
+-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+


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

Reply via email to