Sitecore remove “Job started” and “Job ended” from log files

In large Sitecore installations with many background tasks you will find the following log lines over and over again:

ManagedPoolThread #1 10:26:05 INFO  Job started: xxxxx
ManagedPoolThread #5 10:26:05 INFO  Job ended: xxxxx (units processed: )

This is the Sitecore Agents that write this line by default. You can disable the logging for each running agent by setting the “LogActivity” property to FALSE:

<agent type="Sitecore.Tasks.UrlAgent" method="Run" interval="00:15:00">
  <param desc="url">/sitecore/service/keepalive.aspx</param>
  <LogActivity>false</LogActivity>
</agent>

If you would like to know when your own tasks have been run by an agent, simply add a log line when your code starts:

Log.Info(string.Format("Task started: [taskname]", this);

Please note that you cannot disable all “Job started” log lines in one place, you need to disable them for each agent. You will find agents in the following config files:

  • Sitecore.config
    Sitecore.Tasks.UrlAgent
    Sitecore.Tasks.TaskDatabaseAgent
    and more…
  • Sitecore.Diagnostics.config
    Sitecore.Tasks.CleanupAgent
  • Sitecore.Processing.config
    Sitecore.Tasks.DatabaseAgent
  • Sitecore.WebDAV.config
    Sitecore.Tasks.CleanupFDAObsoleteMediaData, Sitecore.Tasks.WebDAVOptionsCleanupAgent
  • Sitecore.ContentSearch.config
    Sitecore.ContentSearch.Tasks.Optimize
  • Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config
    Sitecore.ContentSearch.SolrProvider.Agents.IsSolrAliveAgent
    Sitecore.ContentSearch.SolrProvider.Agents.IndexingStateSwitcher
  • Sitecore.ContentTesting.config
    Sitecore.Tasks.CleanupAgent
  • Sitecore.EDS.Providers.CustomSMTP.config
    Sitecore.EDS.Providers.CustomSmtp.Tasks.ConnectionPoolAgent
  • Sitecore.EDS.Providers.CustomSMTP.Sync.config
    Sitecore.EDS.Providers.CustomSmtp.Tasks.PullPop3BouncesAgent
  • Sitecore.EDS.Providers.SparkPost.Sync.config
    Sitecore.EDS.Providers.SparkPost.Tasks.SuppressionSyncAgent
    Sitecore.EDS.Providers.SparkPost.Tasks.PullBouncesAgent
    Sitecore.EDS.Providers.SparkPost.Tasks.PullComplaintsAgent
    Sitecore.EDS.Providers.SparkPost.Tasks.ConnectionPoolAgent
  • Sitecore.EmailExperience.ContentManagementPrimary.config
    Sitecore.Tasks.DatabaseAgent
  • Sitecore.ListManagement.config
    Sitecore.ListManagement.Operations.UpdateListOperationsAgent
  • Sitecore.PathAnalyzer.Client.config
    Sitecore.PathAnalyzer.Client.Tasks.HelpUpdateAgent
    Sitecore.PathAnalyzer.Client.Tasks.HelpUpdateAgent

As an untested side note, Log4Net contains filters that should deny certain string patterns. Adding the following to the LogFileAppender in the Sitecore.config file should remove all lines containing “Job started:” and “Job ended:“:

<filter type="log4net.Filter.StringMatchFilter">
  <stringToMatch value="Job started:" />
  <acceptOnMatch value="false" />
</filter>
<filter type="log4net.Filter.StringMatchFilter">
  <stringToMatch value="Job ended:" />
  <acceptOnMatch value="false" />
</filter>

MORE TO READ:

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in Sitecore, Sitecore 6, Sitecore 7, Sitecore 8, Sitecore 9 and tagged , , , . Bookmark the permalink.

1 Response to Sitecore remove “Job started” and “Job ended” from log files

  1. Pingback: Sitecore logging – Create new log file every day | Brian Pedersen's Sitecore and .NET Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.