November Happy Hour will be moved to Thursday December 5th.

Nicklas Israelsson
Feb 1, 2009
  9168
(1 votes)

EPiServer log: Excluding rows from selected namespaces

Whenever I encounter a problem with EPiServer I can't really figure out, usually the first thing I do is create a log while reproducing the error. Logs are one of my best friends when it comes to troubleshooting.

Often I don't know what I'm looking for so I set the level to either "Debug" or "All". This will output a lot of information and create large log files really fast. I have no problem with this since I asked for all information available. But some parts of EPiServer are chattier than others and thus create a lot of noise in my logs. I’m especially thinking of the EPiServer.Core.OptimisticCache namespace. It outputs lots of rows similar to these below:

2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292, retry 1, calling CacheManager.RuntimeCacheGet for key
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292, retry 1, CacheManager.RuntimeCacheGet returned null for key
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292, retry 1, returning null
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292, inserting a RefCountedEvent object in cache
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292, calling ReadAndCacheObject delegate passed
2009-01-21 12:17:53,942 [1] INFO EPiServer.Core.OptimisticCache [(null)] - cacheKey=EPChildrenData:3292, ReadAndCacheObject delegate returned object of type TObject

And even though I’m not quite sure what I’m looking for, I can often rule out if the cache might have anything to do with it or not. So to remove all rows that come from this namespace I just add the following lines to my EPiServerLog.config:

<!-- Removing all rows coming from OptimisticCache -->
<logger name="EPiServer.Core.OptimisticCache" additivity="false">
  <level value="Off"/>
  <appender-ref ref="fileLogAppender" />
</logger>

This helps keep the logs clean from thousands of rows like the ones above and makes it a bit easier to read through.

Just remember what namespaces you exclude. At one time or another you might want one of those lines and then you’ll have to change the EPiServerLog.config again.

Feb 01, 2009

Comments

Sep 21, 2010 10:32 AM

Great article. I got a 1GB log file on labs in just an hour and the site was 10x slower, so you have to be careful with those chatty namespaces.

Petter Klang
Petter Klang Sep 21, 2010 10:32 AM

Perfect! This is going to save some time. Thanks for sharing!

Sep 21, 2010 10:32 AM

Thanks for sharing! Another tip: http://blog.fredrikhaglund.se/blog/2009/02/03/episerver-log-more-configuration-tips/ /Fredrik

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog