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

Exception on Convert for return %class{1} name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.10
    • 1.2.11
    • Core
    • None
    • Windows XP, Visual Studio 2008, .NET 2.0

    Description

      in function^

      override protected void Convert(TextWriter writer, LoggingEvent loggingEvent)
      {
      string name = GetFullyQualifiedName(loggingEvent);
      if (m_precision <= 0)

      { writer.Write(name); }

      else
      {
      int len = name.Length;

      // We subtract 1 from 'len' when assigning to 'end' to avoid out of
      // bounds exception in return name.Substring(end+1, len). This can happen if
      // precision is 1 and the logger name ends with a dot.
      int end = len - 1;
      for(int i=m_precision; i>0; i--)
      {
      end = name.LastIndexOf('.', end - 1);
      if (end == -1)

      { writer.Write(name); return; }

      }
      writer.Write(name.Substring(end+1, len-end-1));
      }
      }

      if "string name = GetFullyQualifiedName(loggingEvent); " return '?' (noname class-name) in line "end = name.LastIndexOf('.', end - 1);" exceptrion because end = 0...

      Attachments

        Activity

          People

            Unassigned Unassigned
            beast Georgievsky Ilya
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified