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 [EMAIL PROTECTED]
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" <[EMAIL PROTECTED]>
To: "Tomcat Developers List" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







--
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:  [EMAIL PROTECTED]




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




------------------------------------------------------------------------


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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



Reply via email to