Bug 41487 - Warning when configuring inner-class logger
Warning when configuring inner-class logger
Status: RESOLVED FIXED
Product: Log4j
Classification: Unclassified
Component: Configurator
1.2
PC Windows XP
: P2 normal
: ---
Assigned To: log4j-dev
:
: 42575 48034 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-01-29 00:58 UTC by Jan Peter Stotz
Modified: 2009-10-23 17:53 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Peter Stotz 2007-01-29 00:58:44 UTC
When I add a logger entry for an inner class to my DOMConfigurator config file 
like this:

<logger name="package.MyClass$MyInnerClass"> 
  <level value="INFO"/>
</logger>

I get the following warnings on the console:

log4j:WARN Continuable parsing error 59 and column 89
log4j:WARN Attribute value "package.MyClass$MyInnerClass" of type ID must be a 
name.

I usually create by Logger classes by the command
log = Logger.getLogger(this.getClass());
and therefore the configured logger do work as expected but every time I start 
my program I get this annoying errors on the console for each logger which is 
configured for an inner class.

(Log4j 1.2.14)
Comment 1 Curt Arnold 2007-01-29 08:49:27 UTC
This is due to the log4j.dtd file embedded in the jar file declaring that the name attribute of the logger 
element to be of type ID which prohibits the $ character.  The DOMConfigurator will log any XML 
validation errors but will otherwise ignore them which results in you getting a distrurbing warning 
message but no other negative consequence.
Comment 2 Curt Arnold 2007-02-22 16:08:04 UTC
Fixed in rev 510723 for log4j 1.2 and 510724 on trunk. 
Comment 3 Curt Arnold 2007-06-04 09:07:46 UTC
*** Bug 42575 has been marked as a duplicate of this bug. ***
Comment 4 Curt Arnold 2009-10-23 17:53:21 UTC
*** Bug 48034 has been marked as a duplicate of this bug. ***