private void FollowLog(JobLog log) { // Wait for PollingPeriod seconds Thread.Sleep(PollingPeriod.Value); // Grab new entries var entries = log.OrderedEntries().TakeWhile(l => l.Timestamp > _lastEntryUtc).Take(NumberOfEntries.Value); var logger = LogManager.GetLogger("joblog." + log.JobName); foreach (var entry in entries) { WriteEntry(logger, entry); _lastEntryUtc = entry.Timestamp; } }
private void WriteEntry(JobLog log, JobLogEntry entry) { Log.Log(entry.FullEvent); }