Monday, January 10, 2011

Prevent Sitecore from logging into the log file

If you have something that Sitecore is logging into the log file and you no longer want it to show up you can ask the log4net class to clear it by updating your web.config accordingly by adding a filter like so within the web.config (this will stop the string “INFO: sitecore/admin has logged in” from being logged into the Sitecore log files.


<log4net>



<appender name=”LogFileAppender” type=”log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging”>



<filter type=”log4net.Filter.StringMatchFilter”>

<stringToMatch value=”INFO: sitecore/admin has logged in” />

<acceptOnMatch value=”false” />

</filter>



</appender>



</log4net>

No comments:

Post a Comment