DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG· RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://issues.apache.org/bugzilla/show_bug.cgi?id=32752>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND· INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=32752 ------- Additional Comments From [EMAIL PROTECTED] 2006-03-23 06:11 ------- (In reply to comment #0) To add to this discussion ... This change is a show stopper for me as I make extensive use of Object.toString () method to dynamically compute the value at log time (not at put time). The main problem with this change is that the workaround is some sort of wrapper to ensure that the MDC content is updated at log point. I think the old behavior should be preserved as it is more flexible and already in use. (I am surprised that so few people have commented this issue on the mailing list). Another point I'd like to raise is that the deprecation of the put() method is accompanied by a behavior change (in 1.3) that will not be easily detected and might silently produce wrong (unexpected) values in existing code. Of course the other options are far from ideal: 1)Remove the deprecated method (and break code compatibility) 2)Log an explicit warning instead of the Object.toString(). The odds of an unwanted change going unnoticed are reduced but some correct code might/would also break. I took a look at the beta8 sources to see what impacts reverting this change would have. Here are my observations: 1)The MDC.put(String, Object) method implementation would replace the val.toString() call by val. public static void put(String key, Object val) { put(key, val.toString()); // before } public static void put(String key, Object val) { put(key, val); // after } 2)The MDC.put(String, Object) method documentation would change to remove the deprecated flag and to eliminate the toString() reference. 3)The LoggingEvent.initializeProperties() method implementation would have to be changed to call the toString() method when copying the MDC context to the properties Map. properties.putAll(mdcMap); // before // start of after (code not tested) Iterator it = mdcMap.entrySet().iterator(); while(it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); properties.put(entry.getKey(), entry.getValue().toString()); } // end of after I have not looked at the impacts of these changes to other existing code (outside log4j). For example, the public MDC.getContext() method (documented as internal) would contain Object that are possibly not Strings as before. Claude -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
