You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (Jira)" <ji...@apache.org> on 2020/04/04 22:30:04 UTC

[jira] [Updated] (LOG4NET-372) Map IObjectRenderer by attribute

     [ https://issues.apache.org/jira/browse/LOG4NET-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ralph Goers updated LOG4NET-372:
--------------------------------

LOG4NET is now dormant.  

> 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 was sent by Atlassian Jira
(v8.3.4#803005)