While on my last project, I used Log4J and grew to love it.  I also learned
the importance of configuring Log4J before making any logging requests.  In
standalone Java apps, for example, I use a DOMConfigurator within main().

Now on a new project, I'm tasked with integrating Log4J into an existing web
application.  This web app is a mix of JSPs and servlets.  I've got three
questions:

First:  when should I configure Log4J?  My Log4J experience, unfortunately,
far outweighs my JSP/servlet experience, but I'm guessing that all I need to
do is use a DOMConfigurator within the init() method of the first servlet
that gets loaded.  (The web app's web.xml specifically requests that the
servlets are loaded on startup, and specifically lists in which order they
should be loaded.)  Does this sound like a reasonable approach?

Next question:  has anybody made logging requests from within a JSP error
page?  By "error page," I'm referring to a JSP that sets isErrorPage="true"
within its <%@ page %> directive.  I'd like to do this, to ensure that
exceptions get logged.  Again... does this sound like a reasonable approach?

Finally, and perhaps most crucially:  other members of my team have
suggested that I create a new Appender that displays high-severity log
messages to the user in a browser frame or a pop-up window.  I've created
custom Appenders before... but would one like this really be possible?  If
so... how?

Thanks in advance for any tips.  BTW, if questions such as these have
already been answered somewhere, feel free just to point me to the right
reference.  I searched through this list's archives, but couldn't manage to
find anything.

Thanks again!

-JC

[EMAIL PROTECTED]
http://www.roguewave.com   

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

Reply via email to