[Cosmo-dev] Re: [commits-cosmo] (travis) [2875] More work on logging component

Brian Moseley bcm at osafoundation.org
Wed Nov 15 15:42:45 PST 2006


On 11/15/06, svncheckin at osafoundation.org <svncheckin at osafoundation.org> wrote:

> + <logger name="org.osaf.cosmo.log.HttpLoggingFilter">
> + <level value="OFF"/>
> + </logger>
> +

i think this filter should log to a more generic channel that is not
named after the java class. i suggest "http-operations". also, i think
it should be logged at INFO and enabled by default.

> + } catch (ClassCastException e) {
> + /*
> + * This is no big deal, we log only the protocol.
> + */
> + log.debug(logMessage);
> + }

i wouldn't bother with this check. we aren't likely to have non-http
servlets in cosmo.

> + this.securityManager =
> + (CosmoSecurityManager) ctx.getBean(securityManagerBeanName);

the bean name doesn't need to be settable. it can be hardcoded like in
all the other servlets.

> + } else {
> + log.warn("No security manager registered for " +
> + "HttpLoggingFilter. Authentication information" +
> + "will not be available.");
> + }

if a security manager is not defined, this is developer error, and the
server shouldn't function at all. you should throw a ServletException
in that case. see MorseCodeServlet#init() for an example.

> + String format = config.getInitParameter("format");

i'd rather this format be provided as a spring bean than a servlet
init param. in general, i've tried to keep this sort of internal
configuration centralized in spring, which i think is a more flexible,
manageable and container-independent config source (i have failed at
this a few times, but i hope to clean those things up over time).

alternatively, have the format be specified in cosmo.properties and
filled into the spring config via the already in-place property
placeholder stuff.


More information about the cosmo-dev mailing list