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

Exception thrown when *Format methods are given a malformed format string

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2.9
    • Fix Version/s: 1.2.10
    • Component/s: None
    • Labels:
      None

      Description

      FormatException thrown when *Format methods are given a malformed format string: log.DebugFormat("Malformed {{,,,5}format

      {8}!");

      This statement:

      log.DebugFormat("Malformed {{,,,5}format{8}

      !");

      throws the following exception:

      [FormatException: Input string was not in a correct format.]
      System.Text.StringBuilder.FormatError()
      System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
      System.String.Format(IFormatProvider provider, String format, Object[] args)
      log4net.Core.LogImpl.DebugFormat(String format, Object[] args)

      which is consistent with the documentation for String.Format:

      System.FormatException: The format item in format is invalid. or The number indicating an argument to format is less than zero, or greater than or equal to the number of specified objects to format.

        Attachments

          Activity

            People

            • Assignee:
              nicko Nicko Cadell
              Reporter:
              ron Ron Grabowski
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: