Surendra Sharma

Surendra Sharma

Search This Blog

Tuesday, March 28, 2017

How to change log level of Sitecore log files



On one of our Sitecore hosted server, log files sizes are growing rapidly. We are fine with few MB, but some of our search logs are growing more than 300 MB as shown below

Logs file in Data\logs folder
Logs file in Data\logs folder

Instead of logging everything, we want to log only error messages to reduce the file sizes.

How to achieve it?

Open your Sitecore web.config file.

Find “<log4net>” and locate logger section for “SearchLogFileAppender

Change its level from INFO to ERROR as

    <logger name="Sitecore.Diagnostics.Search" additivity="false">
      <level value="ERROR"/>
      <appender-ref ref="SearchLogFileAppender"/>
    </logger>

Now your search log should only record searching related errors.

In same way, you can also change log level for Crawling, WebDAV, publishing and Sitecore logs files.

I hope you like this Sitecore trick. Stay tuned for more Sitecore related articles.

Till that happy Sitecoring :)

Please leave your comments or share this trick if it’s useful for you.

No comments:

Post a Comment