Since upgrading to Sitecore 8 one thing that I have noticed is that the log files can be quite noisey. In particular when the default log file is set to INFO this line is written a lot… and I mean a LOT!
1 | Heartbeat 13:48:33 INFO Trace: [Finally] System.Data.SqlClient.SqlCommand.ExecuteReader::Finally; |
Here is a small example of a clean Sitecore installation, no extra code written at this time:
As you can see, this is being written to the logs around 6 times every 2 seconds!
After a bit of digging, I finally located the offending code. And here it is:
1 | /// <summary> |
The code is in Sitecore.Diagnostics.LoggerFactory.SitecoreTraceListener. It looks like it should be doing a Log.Trace rather than Log.Info, then it would obey the log level settings.
###Log4Net to the Rescue
Fortunately Sitecore uses log4net so we can do something about it. Adding the following config to the log4net configuration section stopped Sitecore from filling up the log files with this pointless line!
1 | <logger name="Sitecore.Diagnostics.LoggerFactory.SitecoreTraceListener" additivity="false"> |
So if you are seeing this a lot in your log files, I hope this little tip helps!
– Richard