Issue Details (XML | Word | Printable)

Key: LOG4NET-69
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Nicko Cadell
Reporter: Ron Grabowski
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Log4net

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

Created: 17/Mar/06 01:07 PM   Updated: 28/Mar/06 08:22 AM
Return to search
Component/s: None
Affects Version/s: 1.2.9
Fix Version/s: 1.2.10

Time Tracking:
Not Specified

Resolution Date: 28/Mar/06 08:22 AM


 Description  « Hide
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.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #386707 Fri Mar 17 20:26:53 UTC 2006 nicko Fix for LOG4NET-69.
Added new wrapped implementation of String.Format in Transform.StringFormat. This method will not throw exceptions. Added some more exception handling code to the Logger.
Files Changed
MODIFY /logging/log4net/trunk/log4net.build
MODIFY /logging/log4net/trunk/src/Core/LogImpl.cs
MODIFY /logging/log4net/trunk/src/Repository/Hierarchy/Logger.cs
MODIFY /logging/log4net/trunk/src/Util/Transform.cs
MODIFY /logging/log4net/trunk/extensions/net/1.0/log4net.Ext.Trace/cs/src/TraceLogImpl.cs
MODIFY /logging/log4net/trunk/src/Core/ILogger.cs