Quantcast
Channel: briancaos – Brian Pedersen's Sitecore and .NET Blog
Viewing all articles
Browse latest Browse all 277

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

$
0
0

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:


Viewing all articles
Browse latest Browse all 277

Latest Images

Trending Articles



Latest Images