Understanding Sitecore logs – Part 1: xDB, Tracking, License, Path Analyzer and Memory Monitor

I want to start a series of blogs describing what each line in the Sitecore logs mean. I am basing my research on the log information extracted from Sitecore 9.1 Update-1 with the log priority level set to “INFO”.

Let’s start with the log file.

The log file is usually located in the configured data folder of your website (e.g. \App_Data\logs) and is created with the pattern log.yyyymmdd.hhmmss.txt (e.g. log.20190731.175131.txt).

xDB, Tracking, License logs

13448 16:39:23 INFO  **********************************************************************
13448 16:39:23 INFO  **********************************************************************
13448 16:39:23 INFO  
13448 16:39:23 INFO  xDB is enabled.
13448 16:39:23 INFO  
13448 16:39:23 INFO  Tracking is enabled.
13448 16:39:23 INFO  
13448 16:39:23 INFO  Valid xDB license is present.
13448 16:39:23 INFO  
13448 16:39:23 INFO  **********************************************************************
13448 16:39:23 INFO  **********************************************************************

This is the first block you are going to see and it’s logged by the class Sitecore.Xdb.Configuration.Pipelines.Initialize. ShowXdbInfo, Sitecore.Xdb.Configuration.

It shows:

  • xDB is enabled, based on the Xdb.Enabled setting located in the \App_Config\Sitecore\Marketing.xDB\Sitecore.Xdb.config file or by a configuration patch file.
  • Tracking is enabled, based on the Xdb.Tracking.Enabled setting located in the \App_Config\Sitecore\Marketing.xDB\Sitecore.Xdb.config file or by a configuration patch file.
  • xDB license is present. It checks the license by searching for any of the following keywords within your license file: “Sitecore.xDB.Base”, “Sitecore.xDB.Plus”, “Sitecore.xDB.Premium”, “Sitecore.xDB.Base.Cloud”, “Sitecore.xDB.Plus.Cloud”, “Sitecore.xDB.Premium.Cloud”, “Sitecore.xDB.Enterprise.Cloud”
Figure 1: Sitecore license file

Path Analyzer dependencies

The Path Analyzer is a component which analyzes visitor paths through a website and evaluates the analytics values associated with those visits. You can learn more at the Path Analyzer documentation.

Figure 2: Sitecore path analyzer
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.SequenceAnalyzer.Data.ITreeStorage
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Data.Storage.ITreeDefinitionStorage
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.ITreeDefinitionService
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.IMapItemRepository
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.IMapStatusService
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.IConfiguration
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.SequenceAnalyzer.Configuration.IPruningConfig
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.IContactReader
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Localization.IResourceManager
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Data.Caching.ICache
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.ITreeProvider
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Data.SitecoreData.IItemRepository
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Contracts.IMapItemDeploymentManager
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Data.Storage.ITreeStorageManager
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterType) Sitecore.PathAnalyzer.Rules.IRulesValidator

The block above is logged by the class Sitecore.PathAnalyzer.ApplicationContainer, Sitecore.PathAnalyzer. It basically registers the dependencies for Services, Repositories and others as configured in the files \App_Config\Sitecore\PathAnalyzer\Sitecore.PathAnalyzer.config and \App_Config\Sitecore\PathAnalyzer\Sitecore.PathAnalyzer.RemoteClient.config. The logs only show the interfaces, however you can find the corresponding implementing classes below.

Interface Implementing class
ITreeStorage Sitecore.PathAnalyzer.Data.Storage.SqlStorage, Sitecore.PathAnalyzer
ITreeDefinitionStorage Sitecore.PathAnalyzer.Data.Storage.SqlDefinitionStorage, Sitecore.PathAnalyzer
ITreeDefinitionService Sitecore.PathAnalyzer.Data.TreeDefinitionService, Sitecore.PathAnalyzer
IMapItemRepository Sitecore.PathAnalyzer.Data.MapItemRepository, Sitecore.PathAnalyzer
IMapStatusService Sitecore.PathAnalyzer.Data.MapStatusService, Sitecore.PathAnalyzer
IConfiguration Sitecore.PathAnalyzer.Configuration, Sitecore.PathAnalyzer
IPruningConfig Sitecore.SequenceAnalyzer.Configuration.PruningConfig, Sitecore.SequenceAnalyzer
IContactReader Sitecore.PathAnalyzer.Data.DataReaders.ContactReader, Sitecore.PathAnalyzer
IWebRequestFactory Sitecore.PathAnalyzer.Data.Remote.RemoteWebRequestFactory, Sitecore.PathAnalyzer
IResourceManager Sitecore.PathAnalyzer.Localization.ResourceManager, Sitecore.PathAnalyzer
ICache Sitecore.PathAnalyzer.Data.Caching.TreeCache, Sitecore.PathAnalyzer
ITreeProvider Sitecore.PathAnalyzer.Data.TreeProvider, Sitecore.PathAnalyzer
IItemRepository Sitecore.PathAnalyzer.Data.SitecoreData.ItemRepository, Sitecore.PathAnalyzer
IMapItemDeploymentManager Sitecore.PathAnalyzer.Data.MapItemDeploymentManager, Sitecore.PathAnalyzer
ITreeStorageManager Sitecore.PathAnalyzer.Data.Storage.TreeStorageManager, Sitecore.PathAnalyzer
IRulesValidator Sitecore.PathAnalyzer.Rules.RulesValidator, Sitecore.PathAnalyzer

Inside the configuration files, you find in the comments what is the responsibility of each class.

Figure 3: Comments describing the responsibility of each service/repository from the Path Analyzer

Continuing with the Path Analyzer logs:

27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterModelsForSerialization) Setting serialization info
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterModelsForSerialization) Type 'Sitecore.PathAnalyzer.Data.Models.ExperienceNode, Sitecore.PathAnalyzer' was registered succesfully.
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterModelsForSerialization) Type 'Sitecore.PathAnalyzer.Data.Models.ExperienceTree, Sitecore.PathAnalyzer' was registered succesfully.
27936 17:51:34 INFO  [Path Analyzer](ApplicationContainer.RegisterModelsForSerialization) Type 'Sitecore.PathAnalyzer.Data.Models.PageNode, Sitecore.PathAnalyzer' was registered succesfully.

The block above is still logged by the class Sitecore.PathAnalyzer.ApplicationContainer, Sitecore.PathAnalyzer. It basically registers the dependencies for Models as configured in the files \App_Config\Sitecore\PathAnalyzer\Sitecore.PathAnalyzer.config:

  • Sitecore.PathAnalyzer.Data.Models.ExperienceNode, Sitecore.PathAnalyzer
  • Sitecore.PathAnalyzer.Data.Models.ExperienceTree, Sitecore.PathAnalyzer
  • Sitecore.PathAnalyzer.Data.Models.PageNode, Sitecore.PathAnalyzer

MemoryMonitor

27936 17:51:34 INFO  MemoryMonitor initialized. Threshold: 2 GB. Interval: 00:00:05

MemoryMonitor is a hook implemented by the class Sitecore.Diagnostics.MemoryMonitorHook, Sitecore.Diagnostics. Here’s some of its responsibilities:

  • adjusts the global cache load factor when the memory limit is exceeded
  • clear all caches when the memory limit is exceeded
  • garbage collect when the memory limit is exceeded

It is configured in the \App_Config\Sitecore.config file. The information you see in the log are set in this configuration file.

Figure 4: Memory Hook configuration

This same class is responsible for logging information such as:

Memory usage exceeded the MemoryMonitor threshold. All caches have been cleared.

Memory usage exceeded the MemoryMonitor threshold. Forced GC has been induced.

Memory usage: [number]

Memory used before/after GC: [number] / [number]

The cache load factor have been increased to   [number]. 

Number of suppressed logs due to the minimum time between log entries: [number]. 

That was it for this post.

Credits

Photo by Nathan Lemon on Unsplash

3 thoughts on “Understanding Sitecore logs – Part 1: xDB, Tracking, License, Path Analyzer and Memory Monitor

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