Peter Rossbach wrote:
Hello Remy,

I have made a deeper look at the current cvs logger code stage:

1) ContainerBase.getLogger()

With first getLogger call the Log was build with a strange name!

   public Log getLogger() {

       if (logger != null)
           return (logger);
       String loggerName = null;
       Container current = this;
       while (current != null) {
           loggerName = "[" + current.getName() + "]"
               + ((loggerName != null) ? ("." + loggerName) : "");
           current = current.getParent();
       }
       logger = LogFactory.getLog("Tomcat." + loggerName);
       return (logger);

   }

I think this can be done at init().
head
Context logger    Tomcat.[context].[host].[engine]
Host.logger         Tomcat.[host].[engine]
Engine.Logger     Tomcat.[engine]

Strange syntax...

other convention?:
Context logger    Tomcat.Logger.<engine>.<host>.<context>
                          Tomcat.Logger.<engine>.<host>.ROOT
Host.logger         Tomcat.Logger.<engine>.<host>
Engine.Logger     Tomcat.Logger.<engine>

Current getLogger method not handle ROOT Context!

Well, it's going to be a blank String, so "[]". It's unique, so it's fine.
I think the prerfix should be o.a.ca.core.ContainerBase. (= the classname). "Logger" seems redundant (we know it's a Logger).


2) StandardContext.start()
       L4051..
       String logName = "tomcat." + getParent().getName() + "." +
           ("".equals(getName()) ? "ROOT" : getName()) + ".Context";
       log = org.apache.commons.logging.LogFactory.getLog(logName);

Hmm.
Why the complete init() phase goes to Log with name StandardContext.class and
after start all logging goes to "tomcat.<contextname>.Context" ?

This needs to go.

Rémy


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



Reply via email to