Allow custom default renderer
-----------------------------

         Key: LOG4NET-14
         URL: http://issues.apache.org/jira/browse/LOG4NET-14
     Project: Log4net
        Type: Improvement
  Components: Core  
    Versions: 1.2.9    
 Environment: From sourceforge - 732806 - krishna thotakura - tkkishore
    Reporter: Nicko Cadell


 I request for the following features/changes.

1. The ability to configure a DefaultRenderer.
I could not find a way to do this other than by modifying
RendererMap. The flexibility in having custom loggable
objects and custom renderes is lost. It also does not
allow me to take advantage of the single rooted
hierarchy of .NET. (i.e. i want to format all
objects - string log objects, int log objects, etc. in a
uniform way)

I had to make the following change in the RendererMap
class.

//private static IObjectRenderer s_defaultRenderer = new
DefaultRenderer();
private static IObjectRenderer s_defaultRenderer = new
MyDefaultRenderer();


2. The property "RenderedMessage" in
the "LoggingEvent" class should not contain any
rendering capabilities of its own. I would rely on my
custom renderer and my custom default renderer to do
all the rendering. This makes a clean dilineation of
responsibilities. I had to do comment out the lines
shown below

public string RenderedMessage
{
get
{
if (m_data.Message == null)
{
// if (m_message == null)
// {
// m_data.Message = "";
// }
// else if (m_message is string)
// {
// m_data.Message = (m_message as string);
// }
// else
// {
m_data.Message
= m_repository.RendererMap.FindAndRender
(m_message);
// }
}
return m_data.Message;
}
}


Log4J is an excellent design product otherwise. I have
always admired its flexibility. We have successfully
used it in our java projects and are very pleased with its
performance, and capabilities.


I greatly appreciate your time in considering the above
suggestions. Please let me know what you think about
the above recommendations.

-Krishna.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to