The PatternConverter is the base class for the converters used by the PatternLayout and the PatternString. The WriteDictionary helper method in the base probably does not need extra support for the IDictionaryEnumerator as it is only used to render IDictionary objects.
A call like:
will use the ObjectRenderer to convert the ICollection into a string. The code that does this conversion is in log4net.ObjectRenderer.DefaultRenderer.
The reason why a call like:
does not produce the same output is that the log4net.ObjectRenderer.DefaultRenderer code does not know how to render objects of type IEnumerator.
The HttpRuntime.Cache object (of type System.Web.Caching.Cache) is a dictionary, but it does not implement the IDictionary interface, nor does it implement ICollection. It does implement the IEnumerable interface.
If you just change the log4net.ObjectRenderer.DefaultRenderer so that instead of checking for ICollection it checks for IEnumerable then you can call: