logging-log4net-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Bodewig (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (LOG4NET-157) FAQ for getting the fully-qualified name of a class
Date Tue, 20 Sep 2011 15:42:08 GMT

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

Stefan Bodewig resolved LOG4NET-157.
------------------------------------

    Resolution: Fixed

FAQ modified with svn revision 1173199

I didn't recommend one approach over the other as sometimes it may be desirable to have one
logger for all generic instances while different loggers may be more appropriate in other
cases.

> FAQ for getting the fully-qualified name of a class
> ---------------------------------------------------
>
>                 Key: LOG4NET-157
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-157
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Documentation
>    Affects Versions: 1.2.10
>         Environment: N/A
>            Reporter: Chris Jerdonek
>            Assignee: Ron Grabowski
>            Priority: Minor
>             Fix For: 1.2.11
>
>
> The FAQ here--
> http://logging.apache.org/log4net/release/faq.html
> states that the following are equivalent ways to obtain a logger:
> (1) private static readonly ILog log = LogManager.GetLogger(typeof(Foo));
> (2) private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
> However, these constructs seem to behave differently when the classes involved are generic.
 When generic classes are involved, I believe the former generates a different logger for
each type parameter combination, while the latter generates a different logger if and only
if the number of type parameters is different.
> For example,
> TestClass<T, S> can yield "TestClass`2[[System.Int32..." in the former case and
"TestClass`2" in the latter.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message