[
https://issues.apache.org/jira/browse/LOG4NET-372?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13617006#comment-13617006
]
Carlin Scott commented on LOG4NET-372:
--------------------------------------
That's more or less what should be added to RendererMap.cs. I'm a reflection
novice so there's probably something wrong with the code though.
> Map IObjectRenderer by attribute
> --------------------------------
>
> Key: LOG4NET-372
> URL: https://issues.apache.org/jira/browse/LOG4NET-372
> Project: Log4net
> Issue Type: Improvement
> Components: Core
> Affects Versions: 1.2.11
> Reporter: Carlin Scott
> Priority: Minor
>
> I made a renderer that applies to objects with the DataContract attribute. It
> would be nice if I could instruct log4net to use that renderer for all
> objects with that attribute.
> {code}
> public IObjectRenderer Get(Type type)
> {
> ...
> if (result == null){
> System.Attribute[] attrs =
> System.Attribute.GetCustomAttributes(type); // reflection
> foreach (System.Attribute attr in attrs)
> {
> if(result = Get(attr.GetType()) != null) break;
> }
> ...
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira