Some jobs do not track the number of processed units (item versions, indexes, sites, and so on). As a result, the number of processed units is empty when the job is finished, for example:
INFO Job ended: Index_Update_IndexName=sitecore_web_index (units processed: ) INFO Job ended: Sitecore.ContentSearch.SolrProvider.Agents.IndexingStateSwitcher (units processed: ) INFO Job ended: Sitecore.Tasks.HtmlCacheClearAgent (units processed: )
If a certain job fails and BaseJobOptions.WriteToLog is true (that is a default value), Sitecore logs a separate message before the job ends. For Sitecore Client jobs, an error message can also appear in the UI.
Consider one of the following options:
public static void SignalEnd(JobArgs args) { var job = args.Job; /* Uncomment for 10.0 and newer if (job.Status.State == JobState.Aborted) { job.Status.LogInfo("Job aborted: {0}", job.DisplayName); } */ if (job.Status.Processed > 0) { job.Status.LogInfo("Job ended: {0} (units processed: {1})", job.DisplayName, job.Status.Processed); } else { job.Status.LogInfo("Job ended: {0}", job.DisplayName); } }
<?xml version="1.0" encoding="utf-8" ?> <sitecore xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/" > <pipelines> <job> <processor set:type="Custom.Assembly.Class, Custom.Assembly" method="SignalEnd"/> </job> </pipelines> </sitecore>
Note: If you suspect faulty behavior, for example, a specific job previously displayed the number of processed units but it is now empty, then consider opening a support case for an in-depth investigation.