Try our conversational search powered by Generative AI!

Nicklas Israelsson
Feb 1, 2009
  9058
(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
From Procrastination to Proficiency: Navigating Your Journey to Web Experimentation Certification

Hey there, Optimizely enthusiasts!   Join me in celebrating a milestone – I'm officially a certified web experimentation expert! It's an exhilarati...

Silvio Pacitto | May 17, 2024

GPT-4o Now Available for Optimizely via the AI-Assistant plugin!

I am excited to announce that GPT-4o is now available for Optimizely users through the Epicweb AI-Assistant integration. This means you can leverag...

Luc Gosso (MVP) | May 17, 2024 | Syndicated blog

The downside of being too fast

Today when I was tracking down some changes, I came across this commit comment Who wrote this? Me, almost 5 years ago. I did have a chuckle in my...

Quan Mai | May 17, 2024 | Syndicated blog

Optimizely Forms: Safeguarding Your Data

With the rise of cyber threats and privacy concerns, safeguarding sensitive information has become a top priority for businesses across all...

K Khan | May 16, 2024