Take the community feedback survey now.

Optimizely 12 on DXP - Logging

Vote:
 

I see blog posts about plugging in additional logging with Optimizely 12, for example with Serilog. Is this supported on a DXP hosted site?

#276074
Mar 10, 2022 22:54
Vote:
 

Can confirm I was able to use Serilog on DXP. If it is officially supported, however, I'm not sure

#276112
Mar 11, 2022 9:37
Ted
Vote:
 

The Foundation project uses Serilog: https://github.com/episerver/Foundation/blob/main/src/Foundation/Program.cs

We have also used it on DXP sites without any (known) problems. 🙂

#276123
Mar 11, 2022 15:15
Vote:
 

Do you think making the log file json (Structure logging) would be an issue? Might just need to test.

#276125
Mar 11, 2022 15:32
Vote:
 

Set it up so that you log to Application Insights. No need to write to log files.

#279406
Apr 28, 2022 16:17
Vote:
 

Hi! A follow-up on this topic.  Migrating sites from On-Prem to DXP atm and understanding that Application Insights is doing the logging (I have confirmed that it is logging correctly), what do I do with the current configuration since its invalid?!

Example EPiServerLog.config

:

<appender name="errorFileLogAppender" type="log4net.Appender.RollingFileAppender" >
    <!-- Consider moving the log files to a location outside the web application -->
    <file value="D:\Logs\WebSites\mysite.se\EPiServerErrors.log" />
    <encoding value="utf-8" />
    <staticLogFileName value="true"/>
    <datePattern value=".yyyyMMdd.'log'" />
    <rollingStyle value="Date" />
    <threshold value="Error" />
    <!--<threshold value="Debug" />-->
    <!-- Enable MinimalLock to share log file, use with caution since logging will be considerably slower -->
    <!--lockingModel type="log4net.Appender.FileAppender+MinimalLock" /-->        
    <appendToFile value="true" />
    <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %level %logger: %message%n" />
    </layout>
</appender>

I guess I do not remove the appender section, but perhaps remove the file path and add comment that it is logged by Application Insights and that the settings can be changed in Azure Portal?

 

#341016
Nov 17, 2025 8:07
Ted - Nov 17, 2025 9:40
You should remove that appender altogether in DXP. There is an Application Insights-specific appender for log4net: https://www.nuget.org/packages/Microsoft.ApplicationInsights.Log4NetAppender/
Vote:
 
#341018
Nov 17, 2025 13:17
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.