Re: Configuring Basic Servlet Config

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Nov 18 2003 - 11:21:34 EST

  • Next message: Andrus Adamchik: "Re: [modeler] it would be nice if.."

    On Nov 18, 2003, at 10:46 AM, Scott Finnerty wrote:

    > Another question that has been asked on the list (not necessarily in
    > relation to web apps) is how to use an existing commons/log4j
    > configuration
    > instead of the cayenne canned one. I extended
    > BasicServletConfiguration and
    > overrode "configureLogging()" with an empty implementation and then
    > extended
    > WebApplicationListener and overrode "newConfiguraton(ServletContext)"
    > to
    > return my own BasicServletConfiguration. Then instead of the cayenne
    > WebApplicationListener, I configured for my extension.

    BTW, since "configureLogging" is simply a cover for a call to static
    Configuration.configureCommonLogging(), you may do away without
    subclassing BasicServletConfiguration. Just disable Cayenne logging
    configuration via another static method, and do your own setup:

    // suppress further attempts to load Log4J
    Configuration.setLoggingConfigured(true);

    // do my own Log4J config
    ....

    Not that it matters much of course, either way would work.

    Andrus



    This archive was generated by hypermail 2.0.0 : Tue Nov 18 2003 - 11:21:39 EST