You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Peter Rossbach <pr...@objektpark.de> on 2004/06/24 14:01:13 UTC

Please describe the new Logger System at cvs head.

Hello Remy,

I have problems to configure the new logger system.
Can you send a log4J example to demonstrate the new commons-log Logger 
concept.

How I can configure a log4J system?

I have no success with add log4j.jar and log4j.xml to system class path 
via setclasspath.bat
set 
CLASSPATH=%JAVA_HOME%\lib\tools.jar;%BASEDIR%\bin\log4j.jar;%BASEDIR%\bin

I see only the commons logging default messages.

Only my webapp find the log4j.jar and log4j.xml at my common/lib and 
common/classes
But I want see the server messages

The Logger names are:

Tomcat.<enginename>
Tomcat.<enginename>.<hostname>
Tomcat.<enginename>.<hostname>.<contextname>

correct?

Regards
peter



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Also I thing the the current implementation is not compatible with all 
> Tomcat 5 releases
> How we want migrate all the current Tomcat projects? How we made Logger 
> configuration
> at runtime? Hmm. :-(  

How about continuing using the Tomcat 5.0.x branch instead ?

About the breakage: I have announced many times that there will be core 
changes in this new branch (although in the end, I think it will still 
be very similar from a user perspective - logging is sort of a special 
case, as the way it was done was quite broken :( ), as it is not 
possible to continue improving Tomcat without that. This branch is not 
intended for upgrades from 5.0.x given the lack of tangible benefits.

Rémy

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Peter Rossbach <pr...@objektpark.de>.
Sorry,

Can you configure a correct log4j.xml or log4j.properties with the 
current implementation?

I have spend a lot of time today, but it not working.

<logger 
name="<![CDATA[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]]]>" 
additivity="false">
<level value="DEBUG"/>
<appender-ref ref="catalina"/>
</logger>

The current log4j 1.2.8 Logger.name type is ID not CDATA ...

log4j:ERROR Parsing error on line 58 and column 15
log4j:ERROR The value of attribute "name" associated with an element 
type "logge
r" must not contain the '<' character.
log4j:ERROR Could not parse input source [org.xml.sax.InputSource@18385e3].
org.xml.sax.SAXParseException: The value of attribute "name" associated 
with an
element type "logger" must not contain the '<' character.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at 
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:665)
        at 
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:616)
        at 
org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java
:602)
        at 
org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionCon
verter.java:460)
        at org.apache.log4j.LogManager.<clinit>(LogManager.java:113)
        at org.apache.log4j.Logger.getLogger(Logger.java:85)
        at 
org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.jav
a:229)
        at 
org.apache.commons.logging.impl.Log4JLogger.<init>(Log4JLogger.java:6
5)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)

        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactory
Impl.java:529)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:235)
        at 
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactory
Impl.java:209)
        at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:351)
        at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:53)
log4j:WARN No appenders could be found for logger 
(org.apache.catalina.startup.C
lassLoaderFactory).
log4j:WARN Please initialize the log4j system properly.

---

Also log4j.properties not working
log4j.rootLogger=INFO, stdout

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.catalina=org.apache.log4j.RollingFileAppender
log4j.appender.catalina.File=../logs/catalina-dev.log
log4j.appender.catalina.MaxFileSize=5Mb
log4j.appender.catalina.MaxBackupIndex=10
log4j.appender.catalina.layout=org.apache.log4j.PatternLayout
log4j.appender.catalina.layout.ConversionPattern=%p %t %c - %m%n

log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]= 
DEBUG, catalina

---
Currently the Logger Logname ist very long
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]  ROOT App
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[myapps]  
normal web App

--
with my patch it works.
;-)
.---

Also I thing the the current implementation is not compatible with all 
Tomcat 5 releases
How we want migrate all the current Tomcat projects? How we made Logger 
configuration
at runtime? Hmm. :-(   

regards
Peter

Bill Barker schrieb:

>Except that I can't see why you would want to use the
>'Tomcat.[].[Catalina].[localhost].[myapp]' name except in a 'category'
>element.  Here, the name is defined to be CDATA so you should be fine (or it
>is a log4j bug :).
>
>----- Original Message -----
>From: "Peter Rossbach" <pr...@objektpark.de>
>To: "Tomcat Developers List" <to...@jakarta.apache.org>
>Sent: Thursday, June 24, 2004 11:02 AM
>Subject: Re: Please describe the new Logger System at cvs head.
>
>
>Hey Remy,
>
>please look at the log4j.dtd
>jakarta-log4j-1.2.8\src\java\org\apache\log4j\xml\log4j.dtd
>
>All names from name attributes are from type "ID"
>http://www.w3.org/TR/REC-xml/
>
>XML Attribute from type ID can not have this characters "[]"
>
>Please, accept my change or made a log4j.dtd/ XML conform  implementation.
>
>Thanx,
>Peter
>
>
>Remy Maucherat schrieb:
>
>  
>
>>Peter Rossbach wrote:
>>
>>    
>>
>>>Hello Remy,
>>>
>>>with your Logger naming convention log4j not working
>>>
>>>log4j:ERROR Parsing error on line 57 and column 99
>>>log4j:ERROR Attribute value
>>>"org.apache.catalina.core.CatalinaBase.[].[localhost
>>>].[Catalina]" of type ID must be a name.
>>>
>>>With this logger naming convention it works fine:
>>>      
>>>
>>Sorry, I see nothing in the log4j docs that says that
>>"org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]"
>>(BTW, I know who you are now: you really must be Yoda; "Hmmm, a bug I
>>think there is") is an invalid logger name.
>>
>>The replacement name you're proposing is bad, so I won't use it.
>>
>>Rémy
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
>>
>>
>>    
>>
>
>
>--
>J2EE Systemarchitekt und Tomcat Experte
>
>http://objektpark.de/
>http://www.webapp.de/
>
>Am Josephsschacht 72, 44879 Bochum, Deutschland
>Telefon:  (49) 234 9413228
>Mobil:    (49) 175 1660884
>E-Mail:  pr@objektpark.de
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>  
>
>------------------------------------------------------------------------
>
>
>This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments.
>
>In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail.
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
Bill Barker wrote:
> Except that I can't see why you would want to use the
> 'Tomcat.[].[Catalina].[localhost].[myapp]' name except in a 'category'
> element.  Here, the name is defined to be CDATA so you should be fine (or it
> is a log4j bug :).

Maybe Peter is stressed up because he's going to production with my 
stuff tomorrow or something ;)
I think it's more consistent to use 
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/]

Log category names are even easier to change than JMX names, and since a 
refactoring just started, nothing is set in stone. There will be far 
more disruptive changes (I guess the changes just before were more 
disruptive already).

I used that nested naming so that a logger category can be defined for a 
host and all its child contexts, respecting the semantics of the 
Catalina containers. (this does sound extremely obvious, it's probably a 
waste of time to write it)

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Bill Barker <wb...@wilshire.com>.
Except that I can't see why you would want to use the
'Tomcat.[].[Catalina].[localhost].[myapp]' name except in a 'category'
element.  Here, the name is defined to be CDATA so you should be fine (or it
is a log4j bug :).

----- Original Message -----
From: "Peter Rossbach" <pr...@objektpark.de>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Thursday, June 24, 2004 11:02 AM
Subject: Re: Please describe the new Logger System at cvs head.


Hey Remy,

please look at the log4j.dtd
jakarta-log4j-1.2.8\src\java\org\apache\log4j\xml\log4j.dtd

All names from name attributes are from type "ID"
http://www.w3.org/TR/REC-xml/

XML Attribute from type ID can not have this characters "[]"

Please, accept my change or made a log4j.dtd/ XML conform  implementation.

Thanx,
Peter


Remy Maucherat schrieb:

> Peter Rossbach wrote:
>
>> Hello Remy,
>>
>> with your Logger naming convention log4j not working
>>
>> log4j:ERROR Parsing error on line 57 and column 99
>> log4j:ERROR Attribute value
>> "org.apache.catalina.core.CatalinaBase.[].[localhost
>> ].[Catalina]" of type ID must be a name.
>>
>> With this logger naming convention it works fine:
>
>
> Sorry, I see nothing in the log4j docs that says that
> "org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]"
> (BTW, I know who you are now: you really must be Yoda; "Hmmm, a bug I
> think there is") is an invalid logger name.
>
> The replacement name you're proposing is bad, so I won't use it.
>
> Rémy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>


--
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:    (49) 175 1660884
E-Mail:  pr@objektpark.de




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org



Re: Please describe the new Logger System at cvs head.

Posted by Peter Rossbach <pr...@objektpark.de>.
Hey Remy,

please look at the log4j.dtd
jakarta-log4j-1.2.8\src\java\org\apache\log4j\xml\log4j.dtd

All names from name attributes are from type "ID"
http://www.w3.org/TR/REC-xml/

XML Attribute from type ID can not have this characters "[]"

Please, accept my change or made a log4j.dtd/ XML conform  implementation.

Thanx,
Peter


Remy Maucherat schrieb:

> Peter Rossbach wrote:
>
>> Hello Remy,
>>
>> with your Logger naming convention log4j not working
>>
>> log4j:ERROR Parsing error on line 57 and column 99
>> log4j:ERROR Attribute value 
>> "org.apache.catalina.core.CatalinaBase.[].[localhost
>> ].[Catalina]" of type ID must be a name.
>>
>> With this logger naming convention it works fine:
>
>
> Sorry, I see nothing in the log4j docs that says that 
> "org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]" 
> (BTW, I know who you are now: you really must be Yoda; "Hmmm, a bug I 
> think there is") is an invalid logger name.
>
> The replacement name you're proposing is bad, so I won't use it.
>
> Rémy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>


-- 
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:    (49) 175 1660884
E-Mail:  pr@objektpark.de




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Hello Remy,
> 
> with your Logger naming convention log4j not working
> 
> log4j:ERROR Parsing error on line 57 and column 99
> log4j:ERROR Attribute value 
> "org.apache.catalina.core.CatalinaBase.[].[localhost
> ].[Catalina]" of type ID must be a name.
> 
> With this logger naming convention it works fine:

Sorry, I see nothing in the log4j docs that says that 
"org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[]" (BTW, 
I know who you are now: you really must be Yoda; "Hmmm, a bug I think 
there is") is an invalid logger name.

The replacement name you're proposing is bad, so I won't use it.

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Peter Rossbach <pr...@objektpark.de>.
Hello Remy,

with your Logger naming convention log4j not working

log4j:ERROR Parsing error on line 57 and column 99
log4j:ERROR Attribute value 
"org.apache.catalina.core.CatalinaBase.[].[localhost
].[Catalina]" of type ID must be a name.

With this logger naming convention it works fine:

org.apache.catalina.core.ContainerBase.Catalina.localhost.ROOT

Patch
Index: catalina/src/share/org/apache/catalina/core/ContainerBase.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/ContainerBase.java,v
retrieving revision 1.36
diff -u -r1.36 ContainerBase.java
--- catalina/src/share/org/apache/catalina/core/ContainerBase.java    24 
Jun 2004 15:28:27 -0000    1.36
+++ catalina/src/share/org/apache/catalina/core/ContainerBase.java    24 
Jun 2004 16:49:23 -0000
@@ -36,18 +36,7 @@
 import javax.naming.directory.DirContext;
 import javax.servlet.ServletException;
 
-import org.apache.catalina.Cluster;
-import org.apache.catalina.Container;
-import org.apache.catalina.ContainerEvent;
-import org.apache.catalina.ContainerListener;
-import org.apache.catalina.Lifecycle;
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.Loader;
-import org.apache.catalina.Manager;
-import org.apache.catalina.Pipeline;
-import org.apache.catalina.Realm;
-import org.apache.catalina.Valve;
+import org.apache.catalina.*;
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.util.LifecycleSupport;
@@ -1288,17 +1277,23 @@
         }
         String loggerName = null;
         Container current = this;
+
         while (current != null) {
-            loggerName = "[" + current.getName() + "]"
+            String theName;
+            if(current instanceof StandardContext )
+               theName = "".equals(current.getName()) ? "ROOT" : 
current.getName();
+            else
+               theName= current.getName();
+            loggerName = theName
                 + ((loggerName != null) ? ("." + loggerName) : "");
             current = current.getParent();
         }
         logName = ContainerBase.class.getName() + "." + loggerName;
         return logName;
-       
+
     }
 
-   
+
     // -------------------- JMX and Registration  --------------------
     protected String type;
     protected String domain;
@@ -1310,7 +1305,7 @@
     public ObjectName getJmxName() {
         return oname;
     }
-   
+
     public String getObjectName() {
         if (oname != null) {
             return oname.toString();
@@ -1326,7 +1321,7 @@
             }
             if( parent instanceof StandardEngine ) {
                 domain=((StandardEngine)parent).getDomain();
-            }
+            }
         }
         return domain;
     }
@@ -1334,7 +1329,7 @@
     public void setDomain(String domain) {
         this.domain=domain;
     }
-   
+
     public String getType() {
         return type;
     }
@@ -1405,9 +1400,9 @@
         Container context=null;
         Container host=null;
         Container servlet=null;
-       
+
         StringBuffer suffix=new StringBuffer();
-       
+
         if( container instanceof StandardHost ) {
             host=container;
         } else if( container instanceof StandardContext ) {
@@ -1421,7 +1416,7 @@
         if( context!=null ) {
             String path=((StandardContext)context).getPath();
             suffix.append(",path=").append((path.equals("")) ? "/" : path);
-        }
+        }
         if( host!=null ) suffix.append(",host=").append( host.getName() );
         if( servlet != null ) {
             String name=container.getName();


I have fix this and it works

<logger 
name="org.apache.catalina.core.ContainerBase.Catalina.localhost.ROOT" 
additivity="false">
<level value="DEBUG"/>
<appender-ref ref="catalina"/>
</logger>

OK, I muss changed the bootstrap.jar META-INF dependcies to 
common-logging.jar instead commons-logging-api-jar
Copy common-logging.jar, log4j.jar and log4.xml to bin
delete commons-logging-api.jar

Change bootstrap.jar Manifest
Manifest-Version: 1.0
Main-Class: org.apache.catalina.startup.Bootstrap
Class-Path: jmx.jar commons-daemon.jar commons-logging.jar
Specification-Title: Catalina
Specification-Version: 1.0

Also change setclasspath.bat
set 
CLASSPATH=%JAVA_HOME%\lib\tools.jar;%BASEDIR%\bin\log4j.jar;%BASEDIR%\bin

..

Only thing that not nice with this patch is new StandardContext dependency!

regards
Peter

Remy Maucherat schrieb:

> 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: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>


-- 
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:    (49) 175 1660884
E-Mail:  pr@objektpark.de




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
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: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Peter Rossbach <pr...@objektpark.de>.
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!

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" ?

   other name convention Tomcat.Context.<contextname>

I thing we must do that, before any code from StandardContext generate 
log message.
The CatalinaBase use "Tomcat" and StandarContext used "tomcat" with 
lowercase...

I hope this analyse help to refactor more :-(

regards
peter

Peter Rossbach schrieb:

> Hello Remy,
>
> which logging system you used?
> I thing every host and application can have there own logging devices.
> My problem is:
>    How can I configure dymamic logging device at runtime?
>    For every new host or application
>
> With the old server.xml Logger element this was easy, but now you must 
> known
> there concrete server technic log4j, JDK 1.4 or what ever....
>
> >>
> The c-l-api JAR which is in bin doesn't include the log4j wrapper, 
> this could be the cause of the problems.
> >>
> You mean, that I must add the commons-logging.jar to system-class path?
> Ohh, then I must changed the META-INF from bootstrap.jar, right?
>
> regards
> Peter
> PS: Some people (book writer)  must be the early birds.... :-)
>
> Remy Maucherat schrieb:
>
>> Peter Rossbach wrote:
>>
>>> Hello Remy,
>>>
>>> I have problems to configure the new logger system.
>>> Can you send a log4J example to demonstrate the new commons-log 
>>> Logger concept.
>>>
>>> How I can configure a log4J system?
>>>
>>> I have no success with add log4j.jar and log4j.xml to system class 
>>> path via setclasspath.bat
>>> set 
>>> CLASSPATH=%JAVA_HOME%\lib\tools.jar;%BASEDIR%\bin\log4j.jar;%BASEDIR%\bin 
>>>
>>>
>>> I see only the commons logging default messages.
>>>
>>> Only my webapp find the log4j.jar and log4j.xml at my common/lib and 
>>> common/classes
>>> But I want see the server messages
>>>
>>> The Logger names are:
>>>
>>> Tomcat.<enginename>
>>> Tomcat.<enginename>.<hostname>
>>> Tomcat.<enginename>.<hostname>.<contextname>
>>>
>>> correct?
>>
>>
>>
>> There's no difference with using log4j with the current Tomcat 5.0.x 
>> (which I've never done, sorry), except that there are a few more 
>> categories.
>> The c-l-api JAR which is in bin doesn't include the log4j wrapper, 
>> this could be the cause of the problems.
>>
>> It's funny to always see you looking for trouble with odd builds ;)
>>
>> Rémy
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
>>
>>
>
>


-- 
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:    (49) 175 1660884
E-Mail:  pr@objektpark.de




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Peter Rossbach <pr...@objektpark.de>.
Hello Remy,

which logging system you used?
I thing every host and application can have there own logging devices.
My problem is:
    How can I configure dymamic logging device at runtime?
    For every new host or application

With the old server.xml Logger element this was easy, but now you must known
there concrete server technic log4j, JDK 1.4 or what ever....

 >>
The c-l-api JAR which is in bin doesn't include the log4j wrapper, this 
could be the cause of the problems.
 >>
You mean, that I must add the commons-logging.jar to system-class path?
Ohh, then I must changed the META-INF from bootstrap.jar, right?

regards
Peter
PS: Some people (book writer)  must be the early birds.... :-)

Remy Maucherat schrieb:

> Peter Rossbach wrote:
>
>> Hello Remy,
>>
>> I have problems to configure the new logger system.
>> Can you send a log4J example to demonstrate the new commons-log 
>> Logger concept.
>>
>> How I can configure a log4J system?
>>
>> I have no success with add log4j.jar and log4j.xml to system class 
>> path via setclasspath.bat
>> set 
>> CLASSPATH=%JAVA_HOME%\lib\tools.jar;%BASEDIR%\bin\log4j.jar;%BASEDIR%\bin 
>>
>>
>> I see only the commons logging default messages.
>>
>> Only my webapp find the log4j.jar and log4j.xml at my common/lib and 
>> common/classes
>> But I want see the server messages
>>
>> The Logger names are:
>>
>> Tomcat.<enginename>
>> Tomcat.<enginename>.<hostname>
>> Tomcat.<enginename>.<hostname>.<contextname>
>>
>> correct?
>
>
> There's no difference with using log4j with the current Tomcat 5.0.x 
> (which I've never done, sorry), except that there are a few more 
> categories.
> The c-l-api JAR which is in bin doesn't include the log4j wrapper, 
> this could be the cause of the problems.
>
> It's funny to always see you looking for trouble with odd builds ;)
>
> Rémy
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>
>


-- 
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:    (49) 175 1660884
E-Mail:  pr@objektpark.de




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
Peter Rossbach wrote:
> Hello Remy,
> 
> I have problems to configure the new logger system.
> Can you send a log4J example to demonstrate the new commons-log Logger 
> concept.
> 
> How I can configure a log4J system?
> 
> I have no success with add log4j.jar and log4j.xml to system class path 
> via setclasspath.bat
> set 
> CLASSPATH=%JAVA_HOME%\lib\tools.jar;%BASEDIR%\bin\log4j.jar;%BASEDIR%\bin
> 
> I see only the commons logging default messages.
> 
> Only my webapp find the log4j.jar and log4j.xml at my common/lib and 
> common/classes
> But I want see the server messages
> 
> The Logger names are:
> 
> Tomcat.<enginename>
> Tomcat.<enginename>.<hostname>
> Tomcat.<enginename>.<hostname>.<contextname>
> 
> correct?

There's no difference with using log4j with the current Tomcat 5.0.x 
(which I've never done, sorry), except that there are a few more categories.
The c-l-api JAR which is in bin doesn't include the log4j wrapper, this 
could be the cause of the problems.

It's funny to always see you looking for trouble with odd builds ;)

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message ----- 
From: "Peter Rossbach" <pr...@objektpark.de>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Sunday, June 27, 2004 3:34 AM
Subject: Re: Please describe the new Logger System at cvs head.


> Hello Bill and Remy
>
> your log4j example at new doumentation works fine. Thanx!
> My fault I use the Logger tag instead the category one.
>
> But that we can't change the Logger config at server.xml is not nice.
> The only chance is, declare a Lifecycle Listner or used the Log4J MBean
> direct.
>

Patches are always welcome. :)

IMHO, adding logging configuration to the admin webapp would be a nice
enhancement for TC 5.5.  But since it's not particularly high on my personal
itch-list, I'll shut up about it now :).

> Regards
> Peter
>
> Bill Barker schrieb:
>
> >>>About logging:
> >>>- it is a mistake (nowadays) to define custom loggers in applications
> >>>(JBoss doesn't, and yet it's far more complex); of course, an equally
> >>>big mistake is to provide "logging" services in the Servlet API ;)
> >>>
> >>>
> >>This is only a dream. In a hosting enviroment every customer will
> >>logging different. We offer own logfiles with the <Logger> configuartion
> >>in the context.xml.
> >>This were broken, if your changes are kept.
> >>
> >>My greatest problem is the administration of the log4j configuration.
> >>Where - or better - how can I do this automatically. This question you
> >>don't answer? Is there a discussion done about this problem?
> >>
> >>
> >>
> >
> >Well, the discussion of administering the log4j configuration belongs on
> >log4j-user@logging.apache.org.  However, I'm sure that the Tomcat 5.5
docs
> >will likely have examples (and, yes, patches are always welcome :).
Either
> >that, or Ceki is going to be selling a lot of copies of his book ;-).
> >
> >
> >
> >>Your logger solution is maybe is well solution for a development or
> >>company-intern-used tomcat installation but the UseCase "Webhosting"
> >>have been ignored. If I must administrate every customer logger manually
> >>this is very counterproductively.
> >>
> >>
> >>
> >
> >Actually, with the JMX support in log4j, I would guess that Remy's
changes
> >will make life much easier for the Webhosting crowd.  If there is
interest
> >(meaning patches :), then the admin webapp could even be extended to help
> >with the configuration.
> >
> >
> >
> >>>- the big problem which I want to solve here is that logs are going to
> >>>different places, which is wrong; now, all logs should go to
> >>>commons-logging (or directly to the actual logger that commons-logging
> >>>is wrapping)
> >>>
> >>>
> >>What do you mean with "different places". If you man different places
> >>the logs will be saved than can I say this is a normal behaviour. In
> >>Germany there is a admin tool called "Confixx". This tool saves the logs
> >>in the home directory of the user. Than the user can view and load his
> >>logs with a normal ftp-client.
> >>
> >>Best regards
> >>Thorsten
> >>
> >>
> >>--
> >>Thorsten Kamann
> >>Email: thorsten.kamann@planetes.de
> >>ICQ: 40746578
> >>Yahoo: ThorQue
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >
> >This message is intended only for the use of the person(s) listed above
as the intended recipient(s), and may contain information that is PRIVILEGED
and CONFIDENTIAL.  If you are not an intended recipient, you may not read,
copy, or distribute this message or any attachment. If you received this
communication in error, please notify us immediately by e-mail and then
delete all copies of this message and any attachments.
> >
> >In addition you should be aware that ordinary (unencrypted) e-mail sent
through the Internet is not secure. Do not send confidential or sensitive
information, such as social security numbers, account numbers, personal
identification numbers and passwords, to us via ordinary (unencrypted)
e-mail.
> >
> >
> >
> >------------------------------------------------------------------------
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> >
>
>
> -- 
> J2EE Systemarchitekt und Tomcat Experte
>
> http://objektpark.de/
> http://www.webapp.de/
>
> Am Josephsschacht 72, 44879 Bochum, Deutschland
> Telefon:  (49) 234 9413228
> Mobil:    (49) 175 1660884
> E-Mail:  pr@objektpark.de
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>
>


Re: Please describe the new Logger System at cvs head.

Posted by Peter Rossbach <pr...@objektpark.de>.
Hello Bill and Remy

your log4j example at new doumentation works fine. Thanx!
My fault I use the Logger tag instead the category one.

But that we can't change the Logger config at server.xml is not nice.
The only chance is, declare a Lifecycle Listner or used the Log4J MBean
direct.

Regards
Peter

Bill Barker schrieb:

>>>About logging:
>>>- it is a mistake (nowadays) to define custom loggers in applications
>>>(JBoss doesn't, and yet it's far more complex); of course, an equally
>>>big mistake is to provide "logging" services in the Servlet API ;)
>>>      
>>>
>>This is only a dream. In a hosting enviroment every customer will
>>logging different. We offer own logfiles with the <Logger> configuartion
>>in the context.xml.
>>This were broken, if your changes are kept.
>>
>>My greatest problem is the administration of the log4j configuration.
>>Where - or better - how can I do this automatically. This question you
>>don't answer? Is there a discussion done about this problem?
>>
>>    
>>
>
>Well, the discussion of administering the log4j configuration belongs on
>log4j-user@logging.apache.org.  However, I'm sure that the Tomcat 5.5 docs
>will likely have examples (and, yes, patches are always welcome :).  Either
>that, or Ceki is going to be selling a lot of copies of his book ;-).
>
>  
>
>>Your logger solution is maybe is well solution for a development or
>>company-intern-used tomcat installation but the UseCase "Webhosting"
>>have been ignored. If I must administrate every customer logger manually
>>this is very counterproductively.
>>
>>    
>>
>
>Actually, with the JMX support in log4j, I would guess that Remy's changes
>will make life much easier for the Webhosting crowd.  If there is interest
>(meaning patches :), then the admin webapp could even be extended to help
>with the configuration.
>
>  
>
>>>- the big problem which I want to solve here is that logs are going to
>>>different places, which is wrong; now, all logs should go to
>>>commons-logging (or directly to the actual logger that commons-logging
>>>is wrapping)
>>>      
>>>
>>What do you mean with "different places". If you man different places
>>the logs will be saved than can I say this is a normal behaviour. In
>>Germany there is a admin tool called "Confixx". This tool saves the logs
>>in the home directory of the user. Than the user can view and load his
>>logs with a normal ftp-client.
>>
>>Best regards
>>Thorsten
>>
>>
>>--
>>Thorsten Kamann
>>Email: thorsten.kamann@planetes.de
>>ICQ: 40746578
>>Yahoo: ThorQue
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>>
>>    
>>
>
>  
>
>------------------------------------------------------------------------
>
>
>This message is intended only for the use of the person(s) listed above as the intended recipient(s), and may contain information that is PRIVILEGED and CONFIDENTIAL.  If you are not an intended recipient, you may not read, copy, or distribute this message or any attachment. If you received this communication in error, please notify us immediately by e-mail and then delete all copies of this message and any attachments.
>
>In addition you should be aware that ordinary (unencrypted) e-mail sent through the Internet is not secure. Do not send confidential or sensitive information, such as social security numbers, account numbers, personal identification numbers and passwords, to us via ordinary (unencrypted) e-mail.
>
>  
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


-- 
J2EE Systemarchitekt und Tomcat Experte

http://objektpark.de/
http://www.webapp.de/

Am Josephsschacht 72, 44879 Bochum, Deutschland
Telefon:  (49) 234 9413228
Mobil:    (49) 175 1660884
E-Mail:  pr@objektpark.de




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Bill Barker <wb...@wilshire.com>.
>
> > About logging:
> > - it is a mistake (nowadays) to define custom loggers in applications
> > (JBoss doesn't, and yet it's far more complex); of course, an equally
> > big mistake is to provide "logging" services in the Servlet API ;)
>
> This is only a dream. In a hosting enviroment every customer will
> logging different. We offer own logfiles with the <Logger> configuartion
> in the context.xml.
> This were broken, if your changes are kept.
>
> My greatest problem is the administration of the log4j configuration.
> Where - or better - how can I do this automatically. This question you
> don't answer? Is there a discussion done about this problem?
>

Well, the discussion of administering the log4j configuration belongs on
log4j-user@logging.apache.org.  However, I'm sure that the Tomcat 5.5 docs
will likely have examples (and, yes, patches are always welcome :).  Either
that, or Ceki is going to be selling a lot of copies of his book ;-).

> Your logger solution is maybe is well solution for a development or
> company-intern-used tomcat installation but the UseCase "Webhosting"
> have been ignored. If I must administrate every customer logger manually
> this is very counterproductively.
>

Actually, with the JMX support in log4j, I would guess that Remy's changes
will make life much easier for the Webhosting crowd.  If there is interest
(meaning patches :), then the admin webapp could even be extended to help
with the configuration.

> > - the big problem which I want to solve here is that logs are going to
> > different places, which is wrong; now, all logs should go to
> > commons-logging (or directly to the actual logger that commons-logging
> > is wrapping)
>
> What do you mean with "different places". If you man different places
> the logs will be saved than can I say this is a normal behaviour. In
> Germany there is a admin tool called "Confixx". This tool saves the logs
> in the home directory of the user. Than the user can view and load his
> logs with a normal ftp-client.
>
> Best regards
> Thorsten
>
>
> --
> Thorsten Kamann
> Email: thorsten.kamann@planetes.de
> ICQ: 40746578
> Yahoo: ThorQue
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
>


Re: Please describe the new Logger System at cvs head.

Posted by Thorsten Kamann <th...@planetes.de>.
Hello Remy,

Remy Maucherat schrieb:

> I must be an idiot I think this is not the case. This discussion is 
> closed from my side, since what you write doesn't make any sense.

Hmm, is this your kind to hold a discussion? I think that my question 
are qualified because I must do this things everyday.
In addition to this,  to end a discussion on the way you do is not the 
right way to handle request and comments to project-related items.

But maybe this is the reason why the tomcat project has so few active 
commiters and volunteers that submitting patches?
 
Regards
Thorsten


-- 
Thorsten Kamann
Email: thorsten.kamann@planetes.de
ICQ: 40746578
Yahoo: ThorQue


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
Thorsten Kamann wrote:
> When this branch is so very different from the current 5.0.x, why ist
> thne name not 6.x?

Because it doesn't implement a new spec, and there's no release plan 
anyway at this time.

> This is only a dream. In a hosting enviroment every customer will
> logging different. We offer own logfiles with the <Logger> configuartion
> in the context.xml.
> This were broken, if your changes are kept.
> 
> My greatest problem is the administration of the log4j configuration.
> Where - or better - how can I do this automatically. This question you
> don't answer? Is there a discussion done about this problem?
> 
> Your logger solution is maybe is well solution for a development or
> company-intern-used tomcat installation but the UseCase "Webhosting"
> have been ignored. If I must administrate every customer logger manually
> this is very counterproductively.
> 
>> - the big problem which I want to solve here is that logs are going to 
>> different places, which is wrong; now, all logs should go to 
>> commons-logging (or directly to the actual logger that commons-logging 
>> is wrapping)
> 
> What do you mean with "different places". If you man different places
> the logs will be saved than can I say this is a normal behaviour. In
> Germany there is a admin tool called "Confixx". This tool saves the logs
> in the home directory of the user. Than the user can view and load his
> logs with a normal ftp-client.

Oh ok, so you're telling me that you expect your webapps/frameworks to 
log using four things then:
- ServletContext.log(java.lang.Exception exception, java.lang.String 
msg) (deprecated one ;) )
- ServletContext.log(java.lang.String msg)
- ServletContext.log(java.lang.String message, java.lang.Throwable 
throwable) (the all powerful one, you can do everything with that)
- System.out.println if you did configure swallowOutput (I like that one 
:D )
I must be an idiot I think this is not the case. This discussion is 
closed from my side, since what you write doesn't make any sense.

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Thorsten Kamann <th...@planetes.de>.
Hello Remy,

Remy Maucherat schrieb:

> Thorsten Kamann wrote:
>
>> hello Remy, hello Peter,
>>
>> I am following your dicussion about the new logging in the tomcat cvs.
>>
>> I have some question about this changes:
>> 1. Old configurations in the server.xml and <context>.xml is not valid,
>> because the old logger with <Logger ... /> is defined?
>> 2. How can I automatically configure Log4J to add new categrories if the
>> a host/context added or removed?
>> 3. At wich place the logs will be written if the configuration is not
>> properly set?
>>
>> Our comapny uses the tomcat as a hosting solution for our customers.
>> Every customer has access to his own logs. The logger can be set of the
>> coustomers themselves in their context.xml, of course. Is this behaviour
>> broken after your refactoring is done?
>
>
> A lot of stuff will be broken in this branch. There was no way for me 
> to continue improving Tomcat without breaking stuff. OTOH, I expect 
> the relatively bug free 5.0.x branch to live for a long time, so don't 
> plan upgrading (other than the connector refactoring, there won't be 
> any major reason to upgrade existing installations; this branch is 
> designed for new setups).

When this branch is so very different from the current 5.0.x, why ist
thne name not 6.x?
And why is there no chance to use the old configuration and redirects
internal to the new logger implementation?


> About logging:
> - it is a mistake (nowadays) to define custom loggers in applications 
> (JBoss doesn't, and yet it's far more complex); of course, an equally 
> big mistake is to provide "logging" services in the Servlet API ;)

This is only a dream. In a hosting enviroment every customer will
logging different. We offer own logfiles with the <Logger> configuartion
in the context.xml.
This were broken, if your changes are kept.

My greatest problem is the administration of the log4j configuration.
Where - or better - how can I do this automatically. This question you
don't answer? Is there a discussion done about this problem?

Your logger solution is maybe is well solution for a development or
company-intern-used tomcat installation but the UseCase "Webhosting"
have been ignored. If I must administrate every customer logger manually
this is very counterproductively.

> - the big problem which I want to solve here is that logs are going to 
> different places, which is wrong; now, all logs should go to 
> commons-logging (or directly to the actual logger that commons-logging 
> is wrapping)

What do you mean with "different places". If you man different places
the logs will be saved than can I say this is a normal behaviour. In
Germany there is a admin tool called "Confixx". This tool saves the logs
in the home directory of the user. Than the user can view and load his
logs with a normal ftp-client.

Best regards
Thorsten


-- 
Thorsten Kamann
Email: thorsten.kamann@planetes.de
ICQ: 40746578
Yahoo: ThorQue

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Remy Maucherat <re...@apache.org>.
Thorsten Kamann wrote:
> hello Remy, hello Peter,
> 
> I am following your dicussion about the new logging in the tomcat cvs.
> 
> I have some question about this changes:
> 1. Old configurations in the server.xml and <context>.xml is not valid,
> because the old logger with <Logger ... /> is defined?
> 2. How can I automatically configure Log4J to add new categrories if the
> a host/context added or removed?
> 3. At wich place the logs will be written if the configuration is not
> properly set?
> 
> Our comapny uses the tomcat as a hosting solution for our customers.
> Every customer has access to his own logs. The logger can be set of the
> coustomers themselves in their context.xml, of course. Is this behaviour
> broken after your refactoring is done?

A lot of stuff will be broken in this branch. There was no way for me to 
continue improving Tomcat without breaking stuff. OTOH, I expect the 
relatively bug free 5.0.x branch to live for a long time, so don't plan 
upgrading (other than the connector refactoring, there won't be any 
major reason to upgrade existing installations; this branch is designed 
for new setups).

About logging:
- it is a mistake (nowadays) to define custom loggers in applications 
(JBoss doesn't, and yet it's far more complex); of course, an equally 
big mistake is to provide "logging" services in the Servlet API ;)
- the big problem which I want to solve here is that logs are going to 
different places, which is wrong; now, all logs should go to 
commons-logging (or directly to the actual logger that commons-logging 
is wrapping)
- this was halfway done already in 5.0.x

Rémy


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Re: Please describe the new Logger System at cvs head.

Posted by Thorsten Kamann <th...@planetes.de>.
hello Remy, hello Peter,

I am following your dicussion about the new logging in the tomcat cvs.

I have some question about this changes:
1. Old configurations in the server.xml and <context>.xml is not valid,
because the old logger with <Logger ... /> is defined?
2. How can I automatically configure Log4J to add new categrories if the
a host/context added or removed?
3. At wich place the logs will be written if the configuration is not
properly set?

Our comapny uses the tomcat as a hosting solution for our customers.
Every customer has access to his own logs. The logger can be set of the
coustomers themselves in their context.xml, of course. Is this behaviour
broken after your refactoring is done?

Best regards
Thorsten

-- 
Thorsten Kamann
Email: thorsten.kamann@planetes.de
ICQ: 40746578
Yahoo: ThorQue

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org