public string Parse(string pattern)
 {
     var l = new PatternLayout(pattern, _loggingEvent);
     foreach (var converter in _converters)
     {
         l.AddConverter(converter.Key, converter.Value);
     }
     return l.Parse();
 }
        protected override void Append(LoggingEvent loggingEvent)
        {
            System.Diagnostics.Debug.WriteLine("Appending");

            if (!_eventRateLimiter.Request(loggingEvent.TimeStamp))
            {
                System.Diagnostics.Debug.WriteLine("Appending denied due to event saturation.");
                return;
            }

            if (Layout == null)
                Layout = new PatternLayout("%message");

            var renderedString = RenderLoggingEvent(loggingEvent);

            var patternParser = new PatternParser(loggingEvent);

            if (renderedString.Contains("%"))
                renderedString = patternParser.Parse(renderedString);

            System.Diagnostics.Debug.WriteLine(string.Format("RenderedString: {0}", renderedString));

            ParseProperties(patternParser);

            var parser = new EventMessageParser(renderedString, ConfigOverrides)
                        {
                            DefaultMetricName = _defaultMetricName,
                            DefaultNameSpace = _parsedNamespace,
                            DefaultUnit = _parsedUnit,
                            DefaultDimensions = _parsedDimensions,
                            DefaultTimestamp = _dateTimeOffset
                        };

            if (!string.IsNullOrEmpty(Value) && ConfigOverrides)
                parser.DefaultValue = Double.Parse(Value, CultureInfo.InvariantCulture);

            parser.Parse();

            foreach (var putMetricDataRequest in parser)
                SendItOff(putMetricDataRequest);
        }