Hi Yoav,

Thanks for your valuable feedbacks. One more question I'm putting up.
- Does log4j uses any type of caching mechanism for naming lookup? (Just to
avoid lookup for each request)

Thanks,

Sanjeev

-----Original Message-----
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 04, 2003 6:25 PM
To: Log4J Users List; [EMAIL PROTECTED]
Subject: RE: log4j : some input required



Howdy,

>1. If I'm using JDBCAppender for logging messages to database and if
there
>is problem while logging (Like database is down), can I trap this and
use
>FileAppender to write to file in that case?

Yes.  See JavaDocs for org.apache.log4j.ErrorHandler and its
implementing class org.apache.log4j.FallbackErrorHandler.

>2. What is the performance impact if I'm using all the methods like
>debug(),
>info(), warn() etc. in my program and have set the output level for
error
>only using configuration file? The method calls (to debug(), info()
etc.)
>will have any performance issue?

You can't be adding methods and have zero impact.  There's always a
small impact.  You can really improve performance by enclosing debug()
calls in if(logger.isDebugEnabled()) conditions.  The log4j manual and
the JavaDocs for org.apache.log4j.performance.Logging contain more
details.

As always, the only way to find out for sure with your actual system is
to profile and benchmark your system.

>3. If I need to log into database which will be better options?
>       a) I use JMSAppender and register a component which does
database
>operation.
>       b) I use JDBCAppender directly.

Depends entirely on your architecture: both solutions can work and work
well.  It's more work to use the JMS way, both for coding and for
maintenance (keeping another server up).  But if more than one system
uses this approach, they can share the JMS queue and/or the component
which reads the JMS messages and logs them, thereby giving you a
centralized logging solution for all your apps.

Personally, I'm not a big fan of logging approaches other than
File-based.  Logging is not something I'd like to rely on an external
server for, including a database server.

Yoav Shapira



This e-mail, including any attachments, is a confidential business
communication, and may contain information that is confidential, proprietary
and/or privileged.  This e-mail is intended only for the individual(s) to
whom it is addressed, and may not be saved, copied, printed, disclosed or
used by anyone else.  If you are not the(an) intended recipient, please
immediately delete this e-mail from your computer system and notify the
sender.  Thank you.


---------------------------------------------------------------------
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