You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by Ron Grabowski <ro...@yahoo.com> on 2005/09/11 09:11:27 UTC

Renderers

LoggingEvent.cs contains this code:

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 if (m_repository != null)
   }
   m_data.Message = m_repository.RendererMap.FindAndRender(m_message);
   }
   else
   {
    // Very last resort
    m_data.Message = m_message.ToString();
   }
  }
  return m_data.Message; 
 }
}

How is it possible to create a custom StringRender:

http://logging.apache.org/log4net/release/manual/configuration.html#renderers

if this code:

 else if (m_message is string)

is called before checking in the RendererMap?