public void PatternConverterProperties()
        {
            XmlDocument log4netConfig = new XmlDocument();

            log4netConfig.LoadXml(@"
                <log4net>
                  <appender name=""PatternStringAppender"" type=""UnitTestProject1.Util.PatternStringAppender, UnitTestProject1"">
                    <layout type=""log4net.Layout.SimpleLayout"" />
                    <setting>
                        <converter>
                            <name value=""propertyKeyCount"" />
                            <type value=""UnitTestProject1.Util.PropertyKeyCountPatternConverter, UnitTestProject1"" />
                            <property>
                                <key value=""one-plus-one"" />
                                <value value=""2"" />
                            </property>
                            <property>
                               <key value=""two-plus-two"" />
                               <value value=""4"" />
                            </property> 
                        </converter>
                        <conversionPattern value=""%propertyKeyCount"" />
                    </setting>
                  </appender>
                  <root>
                    <level value=""ALL"" />                  
                    <appender-ref ref=""PatternStringAppender"" />
                  </root>  
                </log4net>");

            ILoggerRepository rep = LogManager.CreateRepository(Guid.NewGuid().ToString());

            XmlConfigurator.Configure(rep, log4netConfig["log4net"]);

            ILog log = LogManager.GetLogger(rep.Name, "PatternConverterProperties");

            log.Debug("Message");

            PropertyKeyCountPatternConverter converter = PropertyKeyCountPatternConverter.MostRecentInstance;

            Assert.AreEqual(2, converter.Properties.Count);
            Assert.AreEqual("4", converter.Properties["two-plus-two"]);

            PatternStringAppender appender = (PatternStringAppender)LogManager.GetRepository(rep.Name).GetAppenders()[0];

            Assert.AreEqual("2", appender.Setting.Format());
        }
 public PatternStringAppender()
 {
     mostRecentInstace = this;
 }