Laurent Vanzeune wrote:

> Hi,
>
> I know this question has already been asked some time ago but let me
> insist. Are they any limitation/consideration using log4j in an EJB
> environment ?

The biggest problem is that unless you are using something like the
JMSAppender (messaging) or JDBCAppender (database), you have a tough time
using an EJB as a front-end to Log4J.  What I mean is this:  a majority
of people who use log4j will log messages to a file.  You may have many
different types of files, one for error, one for trace/debug, one for
warning, etc.  But the point is, you are logging to a single error file,
not multiple.  So how do you log an error to an error log file within
EJB?  You really can't use an EJB bean as your logging mechanism because
of two reasons: 1) EJBs does not support singletons and 2) the
specification states that file I/O is not allowed from a EJB bean.  This
includes any Java classes callable from an EJB bean.  Neither of these
are hard and fast rules because various EJB vendors have work arounds to
support singletons and I have yet to see a vendor actually prevent you
from doing file I/O.  Personally, what I do is when I start a project is
I build either a CORBA or RMI singleton service (depending on what is
supported by the EJB application server) that front's my log4j
implmentation.

--
Perry Hoekstra
E-Commerce Architect
Talent Software Services
[EMAIL PROTECTED]



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

Reply via email to