Hi,
I haven't got any experience with JMSAppender,
but here's a few comments anyway, for what
they're worth:
> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, February 16, 2001 5:06 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Question about logging in EJB
>
> I am developing logging functionality for an EJB application. My
> application will be running in a clustered environment, but I want to keep
> one central log file. My first thought was to send the logging
> information
> to a central JMS queue. A central listener would then get all of the log
> messages, and log them to file, etc.
[Kitching Simon]
That seems to be a reasonable approach to me.
You may wish to look into using AsyncAppender as a "wrapper"
around JMSAppender to avoid delays in your code while messages
are logged via JMS (see AsyncAppender documentation..).
As far as I am aware, the JMSAppender code is fairly new, and
has not been heavily used (sorry to the author if I have got that
wrong), but even if you do have to do a bit of work on it,
the rest of the log4j framework *is* robust & ready to use.
> I see that you have a JMSAppender, but I have not been able to find any
> documentation or examples. My understanding is that the appender will
> route
> the output of the logging to JMS instead of a file, etc. If this is the
> case I will need a second simpler "logger" in the JMS listener to write
> the
> data to file, etc. Should I use log4j two times??
[Kitching Simon]
log4j can be configured so that a single message can be sent
to any desired number of appenders. This means that writing
the messages to a file *and* a JMSAppender at the same
time is not a problem. Assuming you are configuring log4j
using a properties file, you put something like:
log4j.category.com.acme= ERROR, appender1, appender2
where appender1 is a FileAppender, and appender2 is a
JMSAppender in your case....you can also set threshold
attributes on the appenders if you want to send less
messages via JMS than to file.
> I am curious if anyone else has solved this problem in a cool way.
>
> Thanks in advance,
>
> Daniel Jacobson
>
> ---------------------------------------------------------------------
> 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]