protected override void InitPayLoad()

in src/Serilog.Sinks.AzureDataExplorer/Durable/AzureDataExplorerPayloadReader.cs [49:64]


        protected override void InitPayLoad(string filename)
        {
            m_payload = new List<LogEvent>();
            var lastToken = filename.Split('-').Last();

            // lastToken should be something like 20150218.log or 20150218_3.log now
            if (!lastToken.ToLowerInvariant().EndsWith(".clef"))
            {
                throw new FormatException(string.Format(
                    "The file name '{0}' does not seem to follow the right file pattern - it must be named [whatever]-{{Date}}[_n].clef", Path.GetFileName(filename)));
            }

            var dateFormat = m_rollingInterval.GetFormat();
            var dateString = lastToken.Substring(0, dateFormat.Length);
            DateTime.ParseExact(dateString, dateFormat, CultureInfo.InvariantCulture);
        }