Example #1
0
        public ActionResult <PingLogs> GetLogs()
        {
            IReadOnlyList <string> logs = _telemetryBuffer.GetFirst();

            var response = new PingLogs
            {
                Version  = Assembly.GetExecutingAssembly().GetName().Version?.ToString() ?? "unknown",
                Count    = logs.Count,
                Messages = logs
                           .Take(100)
                           .ToList(),
            };

            return(Ok(response));
        }