Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-157

FAQ for getting the fully-qualified name of a class

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.11
    • Component/s: Documentation
    • Labels:
      None
    • Environment:
      N/A

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ron Ron Grabowski
                Reporter:
                jerdonek Chris Jerdonek
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: