SaaS CMS has officially launched! Learn more now.

Nicklas Israelsson
Feb 1, 2009
  9093
(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
A day in the life of an Optimizely Developer - London Meetup 2024

Hello and welcome to another instalment of A Day In The Life Of An Optimizely Developer. Last night (11th July 2024) I was excited to have attended...

Graham Carr | Jul 16, 2024

Creating Custom Actors for Optimizely Forms

Optimizely Forms is a powerful tool for creating web forms for various purposes such as registrations, job applications, surveys, etc. By default,...

Nahid | Jul 16, 2024

Optimizely SaaS CMS Concepts and Terminologies

Whether you're a new user of Optimizely CMS or a veteran who have been through the evolution of it, the SaaS CMS is bringing some new concepts and...

Patrick Lam | Jul 15, 2024

How to have a link plugin with extra link id attribute in TinyMce

Introduce Optimizely CMS Editing is using TinyMce for editing rich-text content. We need to use this control a lot in CMS site for kind of WYSWYG...

Binh Nguyen Thi | Jul 13, 2024

Create your first demo site with Optimizely SaaS/Visual Builder

Hello everyone, We are very excited about the launch of our SaaS CMS and the new Visual Builder that comes with it. Since it is the first time you'...

Patrick Lam | Jul 11, 2024

Integrate a CMP workflow step with CMS

As you might know Optimizely has an integration where you can create and edit pages in the CMS directly from the CMP. One of the benefits of this i...

Marcus Hoffmann | Jul 10, 2024