You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by bu...@apache.org on 2007/06/11 16:55:55 UTC

DO NOT REPLY [Bug 42634] New: - ObjectRenderer is never triggered in nlog4j 1.2.25

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=42634>.
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=42634

           Summary: ObjectRenderer is never triggered in nlog4j 1.2.25
           Product: Log4j
           Version: unspecified
          Platform: Other
        OS/Version: Windows XP
            Status: NEW
          Severity: regression
          Priority: P2
         Component: Other
        AssignedTo: log4j-dev@logging.apache.org
        ReportedBy: dorian.dinh@gmail.com


public
  String getRenderedMessage() {
     if(renderedMessage == null && message != null) {
       if(message instanceof String)
	 renderedMessage = (String) message;
       else {
	 LoggerRepository repository = logger.getLoggerRepository();

	 if(repository instanceof RendererSupport) {
	   RendererSupport rs = (RendererSupport) repository;
	   renderedMessage= rs.getRendererMap().findAndRender(message);
	 } else {
	   renderedMessage = message.toString();
	 }
       }
     }
     return renderedMessage;
  }


in nlog4j 1.2.25 : (message instanceof String) seems to always return "true" 
so Renderer are never triggered. Is that normal ? I make the test with log4j 
1.2.14 : its OK, my renderers are working. In nlog4j the signature like "debug
(Object)" is deprecated. How can I trigger my Renderer with NLog4j without 
this method ? toString() is systematically called on a untype parameter 
(object kind).

Thx forward.

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


DO NOT REPLY [Bug 42634] - ObjectRenderer is never triggered in nlog4j 1.2.25

Posted by bu...@apache.org.
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=42634>.
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=42634


carnold@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Additional Comments From carnold@apache.org  2007-06-11 10:06 -------
nlog4j is not an Apache Software Foundation product.  Your description suggests that Apache log4j 
works as expected and nlog4j doesn't.  If you have a bug report against nlog4j, you should file it with 
its maintainer (http://www.slf4j.org/nlog4j/)

There was a recent discussion on log4j-user on Object Renderers (http://marc.info/?
t=118064700000001&r=1&w=2).  ObjectRenderers were intended to provide custom conversion of 
non-String messages to strings.  log4j allows you to pass any Object as a message parameter, if the 
message is a string (by far the most common), no conversion is performed, otherwise the repository is 
checked for a matching renderer or if non Object.toString() is called.

If you are passing String objects as message parameters and want to do some manipulation of the 
content before output, then you should be investigating a custom Layout.

-- 
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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org