I am getting the following event log error on a production site. This does not occur on any other environment (dev, QA or stage). It occurs almost every day if not every day. Sometimes it's once a day, other times it is a couple dozen times. Sometimes it will occur every few seconds, then maybe not for a couple of hours.
EventID: 52560986
EventType: E
EventTime: 2/26/2025 9:47:25 PM
Source: Microsoft.AspNetCore.Server.IIS.Core.IISHttpServer
EventCode: 0
EventDescription: Unexpected exception in IISHttpContext.HandleRequest.
Message: An error occurred while writing to logger(s). (Invalid URI: The format of the URI could not be determined.)
Exception type: System.AggregateException
Stack trace:
at Microsoft.Extensions.Logging.Logger.ThrowLoggingError(List'1 exceptions)
at Microsoft.Extensions.Logging.Logger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func'3 formatter)
at Microsoft.Extensions.Logging.Logger'1.Microsoft.Extensions.Logging.ILogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func'3 formatter)
at Microsoft.Extensions.Logging.LoggerMessage.<>c__DisplayClass12_0'2.g__Log|0(ILogger logger, T1 arg1, T2 arg2, Exception exception)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.Log.ApplicationError(ILogger logger, String connectionId, String traceIdentifier, Exception ex)
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT'1.ProcessRequestAsync()
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContextOfT'1.ProcessRequestAsync()
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.HandleRequest()
Message: Invalid URI: The format of the URI could not be determined.
Exception type: System.UriFormatException
Stack trace:
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
at System.Uri..ctor(String uriString)
at CMS.Helpers.RequestContext.get_URLReferrer()
at CMS.EventLog.EventLogService.LogEvent(EventLogData eventLogData)
at Kentico.Web.Mvc.KenticoEventLogLogger.Log[TState](LogLevel logLevel, EventId eventId, TState state, Exception exception, Func`3 formatter)
at Microsoft.Extensions.Logging.Logger.g__LoggerLog|14_0[TState](LogLevel logLevel, EventId eventId, ILogger logger, Exception exception, Func'3 formatter, List'1& exceptions, TState& state)
EventMachineName: Matches web server name in system