Ok, I'm answering my own message. According to this (and I'm sure it is also written in the spec as well)....
http://www.codenotes.com/articles/articleAction.aspx?articleID=159
<quote> ID
Values for attributes of type ID follow two main rules: First, the they must be legal XML names; that is, they can only begin with a letter or underscore character, cannot contain any characters other than letters, numbers, dashes, periods, and underscores, and cannot contain spaces.
</quote>
So, it looks like the context loggers are unfortunately named. I suppose a properties file would work, but what if one wants to use the JoranConfigurator in Log4j-1.3? That will have the same issue as the DOMConfigurator.
I wonder if we might modify the log4j.dtd to not mark the "name" attribute as of type "ID"? Enforcement of uniqueness in the "name" attribute is desirable, but I don't think it is worth not being able to configure loggers which, outside of the config file, have no enforcement of XML-friendly naming constraints. Of course, this assumes that when they talk about "legal XML names" above, that this applies only to attributes of type ID and not all attributes. If this assumption doesn't hold, then we are just stuck with properties files, I guess.
Can anyone confirm my findings? Any thoughts on the best way forward?
Jake
At 12:33 AM 11/12/2004 -0600, you wrote:
>
>Hi everyone,
>
>I'm trying to configure a context log logger for Tomcat-5.5.4.
>
>The docs say...
><quote>
>A context is associated with the
>org.apache.catalina.core.ContainerBase.[enginename].[hostname].[path] log
>category. Note that the brackets are actually part of the name, don't omit
>them.
></quote>
>
>I've tried this...
><logger
>name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mycont
>ext]">
>
>I've even tried escaping everything like this (note, the escape for the
>forward slash, '⁄', shows up as '?' in this case, which is somewhat
>beside the point, but I thought I'd mention it) ...
><logger
>name="org.apache.catalina.core.ContainerBase.[Catalina].
>B;localhost].[⁄mycontext]">
>
>
>In both cases, I get the following message from Log4j...
>
>log4j:ERROR Parsing error on line 32 and column 116
>log4j:ERROR Attribute value
>"org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/mycontext]"
>of type ID must be a name.
>
>
>Is this simply an unfortunate naming scheme by the Tomcat team (the use of
>square brackets and the slash for the path) of which the DOMConfigurator
>(or XML parsers in general) can't deal with, or am I missing something?
>
>
>Jake
>
>
>---------------------------------------------------------------------
>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]
