Bug 38680 - Incorrect message when specified custom level class does not implement class function toLevel
Summary: Incorrect message when specified custom level class does not implement class ...
Status: RESOLVED FIXED
Alias: None
Product: Log4j - Now in Jira
Classification: Unclassified
Component: Configurator (show other bugs)
Version: unspecified
Hardware: Other All
: P2 minor
Target Milestone: ---
Assignee: log4j-dev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-16 15:41 UTC by Ernst de Haan
Modified: 2007-02-20 15:17 UTC (History)
0 users



Attachments
Patch for bug 38680 (779 bytes, patch)
2006-02-16 16:03 UTC, Ernst de Haan
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ernst de Haan 2006-02-16 15:41:47 UTC
Steps to reproduce:
1. Have an application that uses a properties configurator
2. Specify a level NOTICE#java.lang.Object in the properties
3. Start the application

Expected behaviour:
- A message explaining that a class function with the signature
"toLevel(String,Level)" must exist.

Actual behaviour:
- The following output:
log4j:WARN custom level class [java.lang.Object] does not have a constructor
which takes one string parameter
java.lang.NoSuchMethodException: java.lang.Object.toLevel(java.lang.String,
org.apache.log4j.Level)

This is witnessed with the actual code from SVN (revision 378256).
Comment 1 Ernst de Haan 2006-02-16 16:03:21 UTC
Created attachment 17713 [details]
Patch for bug 38680

Attached is a proposed patch.
Comment 2 Elias Ross 2007-01-28 04:09:52 UTC
Applied in SVN trunk
Comment 3 Curt Arnold 2007-01-30 15:37:22 UTC
Committed by Elias in rev 38680 against log4j/trunk.

Also present in log4j 1.2.x.  Likely the message is a hold-over from an earlier implementation that actually 
used a constructor.  Could be considered for back-porting.
Comment 4 Curt Arnold 2007-02-20 15:17:40 UTC
Committed against log4j 1.2 rev 509804.