public ActionResult Entries(string hostedServiceName, string threshold, int skip = 0, int count = InitialEntriesCount, string olderThanToken = null, string newerThanToken = null) { if (count < 1 || count > 100) { throw new ArgumentOutOfRangeException("count", "Must be in range [1;100]."); } InitializeDeploymentTenant(hostedServiceName); var entries = new CloudLogReader(Storage.BlobStorage) .GetLogsOfLevelOrHigher(ParseLogLevel(threshold), skip); if (!string.IsNullOrWhiteSpace(olderThanToken)) { entries = entries.SkipWhile(entry => string.Compare(EntryToToken(entry), olderThanToken) >= 0); } if (!string.IsNullOrWhiteSpace(newerThanToken)) { entries = entries.TakeWhile(entry => string.Compare(EntryToToken(entry), newerThanToken) > 0); } entries = entries.Take(count); return(Json(LogEntriesToModel(entries.ToArray(), count), JsonRequestBehavior.AllowGet)); }
public override ActionResult ByHostedService(string hostedServiceName) { InitializeDeploymentTenant(hostedServiceName); var entries = new CloudLogReader(Storage.BlobStorage) .GetLogsOfLevelOrHigher(LogLevel.Info) .Take(InitialEntriesCount); return(View(LogEntriesToModel(entries.ToArray(), InitialEntriesCount))); }