"Couldn't retrieve device information for user agent" error in the log records when Device Detection is disabled


Description

When the DeviceDetection.Enabled setting is set to false the following error might appear in the log records:

ERROR Couldn't retrieve device information for user agent: [user agent name]
Exception: Sitecore.CES.DeviceDetection.Exceptions.DeviceDetectionException
Message: Device detection is disabled
Source: Sitecore.CES.DeviceDetection
at Sitecore.CES.DeviceDetection.DefaultDeviceDetectionManager.GetDeviceInformation(String userAgent)
at Sitecore.Analytics.XConnect.DataAccess.Pipelines.ConvertToXConnectInteractionPipeline.ConvertToXConnectInteractionProcessor.ProcessGetUserAgentInfo(ConvertToXConnectInteractionPipelineArgs args)

Solution

To resolve the issue, consider one of the following options:

Alternatively, because the behavior does not affect the functionality, you can prevent errors from appearing in the log records. To do this, add the filter to the LogFileAppender, as follows:

<filter type="log4net.Filter.StringMatchFilter">
    <stringToMatch value="retrieve device information for user agent"/>
    <acceptOnMatch value="false" />
</filter>