At 11:46 AM 8/25/2003 -0400, you wrote:

Howdy,

>Cool.  I'll check the stuff in and let you add the documentation.  BTW,
do
>you agree with the packages I suggested?  Ceki seemed to have some
>reservations with the o.a.l.appender package.  What else should I use?

I don't have a problem with the package names, don't really care what
they are ;)  Perhaps calling it org.apache.log4j.contrib.appender for
now and reconsidering later (if/when submitted into log4j core) will
appease your both?  Or maybe org.apache.log4j.servlet.appender as this
really is only applicable to servlets.

Putting it is the o.a.l.servlet package is where I would normally put it, but there are some issues with where the servlets exist (webapp class loader or global class loader). I can't remember all the details right now. Hmm.... I'll test some stuff again and see if this is still an issue. This was the reason for the separate servlet and selector jars. I'll see if this is still necessary. If not, then putting everything under the o.a.l.servlet package is just fine with me.


>Yeah, I thought about this as well.  I guess it is a matter of choosing
>something both unique and predictable.  It has to be predictable if we
are
>going to add it to a configuration file.  Maybe we could just write the
>context path name and obtain it from getResource("/") like you
suggested,
>but format the result to be simply "MyContext".  That way, we can just
>write the name of the context in configuration.

What configuration file are you referring to?  I thought the map of
servlet context "name" (or hashcode etc.) to appender is going to exist
only in memory?

Well, yes, but you have to tell the appender what servlet context to log to. In the current implementation, that is keyed by the servlet context name. So, you have to do something like this in your log4j.xml...


<appender name="ServletContext" class="org.apache.log4j.appender.ServletContextLogAppender">
<param name="servletContextName" value="Barracuda Presentation Framework" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%-5p][%-20.20t]: %39.39c{3} - %m"/>
</layout>
</appender>


here is how the servlet context is registered with the appender in the contextInitialized()...

ServletContextLogAppender.servletContexts.put(servletContext.getServletContextName(), servletContext);

here is how the servlet context to be written to is chosen...

if (servletContext == null)
servletContext = (ServletContext) servletContexts.get(servletContextName);
// If servlet context is not found, signal an error
if (servletContext == null)
{
errorHandler.error("Servlet context [" +
servletContextName +
"] could not be found.");
return;
}



So, if you don't supply the appropriate configuration, then the appender will report an error and log nothing even if you've done the servlet context listener registration of your context. Does that make more sense now?


Jake

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