Appending Sitecore Logs into Application Insights

Sitecore uses log4net, which makes it relatively easy to set up new destinations for logs, etc.. One request we’d had was to log messages in the Sitecore logs into Application Insights.

I approached this by writing a custom appender, which would take our messages and write them to App Insights as Trace messages. This is what I came up with:

Continue reading “Appending Sitecore Logs into Application Insights”
Appending Sitecore Logs into Application Insights

Sitecore’s LevelRangeFilter may unexpectedly terminate your log4net filter chain

TL;DR – Due to strange functionality and a poorly chosen default, Sitecore’s log4net.Filter.LevelRangeFilter may unexpectly terminate the chain of log4net filters you’ve configured, without later filters even being considered. This can be fixed by setting the “AcceptsOnMatch” attribute to false.

Continue reading “Sitecore’s LevelRangeFilter may unexpectedly terminate your log4net filter chain”
Sitecore’s LevelRangeFilter may unexpectedly terminate your log4net filter chain

Writing Sitecore Logs to Azure Application Insights in IAAS/On Prem

Sitecore’s installer for Azure app services installs a neat feature; a Log4Net appender that writes Sitecore log entries to Application Insights as TRACE messages. Nifty! However, for reasons I cannot comprehend, this is not included in the normal installer. That’s a terrible shame, as App Insights is still useful for Sitecore running on actual tin or in a VM.

Continue reading “Writing Sitecore Logs to Azure Application Insights in IAAS/On Prem”
Writing Sitecore Logs to Azure Application Insights in IAAS/On Prem