Carol McDonald - Sun Developer Relations wrote:
> 1) What is the best recommended way (within the standards) to
> do logging for an EJB application?
> I want to have 1 (singleton) object responsible
> for logging to a file.
Well, you've partially answered your own question. :-) EJBs cannot
themselves do file I/O, as you've probably realized. So one way to
solve this problem would be to do what you're talking about, viz. have
something like a singleton RMI object in a registry somewhere that you
tell via RMI to go do some logging. (I *think* this is legal.)
A better way might be to do some kind of event spewing, where either you
get a reference to a JMS provider and fire events instead of logging
(then listeners can do whatever they like with those events), or you
open a socket to some daemon program running out-of-process and fire
"events" over the socket. But both of these are custom solutions that
may be hard to carry around from project to project.
As I understand it, in EJB 2.0 there will be? perhaps? some kind of YAA
(Yet Another Architecture) that will dictate how a bean can get to the
filesystem, as well as mandatory JMS support, so a message-based logging
setup might be good if your logging isn't too horribly frequent.
Wow, that went on for a bit; sorry about that.
Cheers,
Laird
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".