Live Dangerously and Ignore Those GeoIp Warnings!

Or don't. But you should. During a new rollout of Sitecore 10.3 I found thousands of warnings in my logs which should be ignored as they are at the wrong level, and I can show you how to keep a clean log against them as well.


What Is Going On With the Logs?

While working with a new implementation of Sitecore 10.3 that heavily leverages GeoIp, I found what appeared to be an issue, since there were thousands of log entries similar to:

WARN Robot Detection.Exclude Robots: Before Device Detection Bot call
WARN Robot Detection.Exclude Robots: After Successful Device Detection Bot call

The first thing I did was reference our own custom logging capabilities which I posted about recently under Lessons Learned From Troubleshooting Geoip Results in Sitecore. Everything seemed to be working according to plan, and our customer service team has had no complaints, so what gives?


CheckDeviceType Logging Levels

The Sitecore.Analytics.Pipelines.ExcludeRobots.CheckDeviceType processor is erroneulsy logging these occurrences as a Warn, and should also only be happening once per session. Maybe something stateless is running against the site which can cause so many entries, but the logging level can also be changed to avoid undue concern. The change request of 607625 has been created to update future releases. 


Clean up your logs!

The following change can be made against your Appender configuration so they can be ignored if your release is doing the same. The part you want to patch is the Filter configuration.

<appender name="LogFileAppender" type="log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging">
  <file value="$(dataFolder)/logs/log.{date}.txt" />
  <appendToFile value="true" />
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%4t %d{ABSOLUTE} %-5p %m%n" />
  </layout>
  <filter type="log4net.Filter.StringMatchFilter">
    <stringToMatch value="Device Detection Bot call"/>
    <acceptOnMatch value="false"/>
  </filter>
  <encoding value="utf-8" />
</appender>