AI OnAI Off
Note that log4net is not working on Azure (therefore DXC) if you are using that
If you are not, then make sure your apppool has write access to log folder
Hi Quan,
Thanks for quick response, as we can see an empty file generated each day , means the folder (in our case App_Data) is having access to wrire a text file. As you mentioned that "log4net is not working on Azure" , yes we are using log4net only. Can you suggest any other way for logging in episerver that will work on Azure (therefore DXC) .
In production environment metods like 'logger.Error("Some error message")' creating a 'EPiServerErrors.log' , but the message text is not written to. We are getting only empty files only. What can be the cause for this issue?. In our local host everything working fine.We are using Episerver version 11.Our configuration:
<?xml version="1.0" encoding="utf-8"?>
<log4net>
<!-- Reduce amount of debug logging -->
<logger name="EPiServer.Core.OptimisticCache" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Core.ContentProvider" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Data.Dynamic.Providers.DbDataStoreProvider" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Data.Providers.SqlDatabaseHandler" additivity="false">
<level value="Error" />
</logger>
<logger name="EPiServer.Data.Providers.ConnectionContext" additivity="false">
<level value="Error" />
</logger>
<root>
<!--Be careful, setting this value to All, Debug or Info will affect performance.-->
<level value="Error"/>
<appender-ref ref="errorFileLogAppender"/>
</root>
<appender name="errorFileLogAppender" type="log4net.Appender.RollingFileAppender">
<!-- Consider moving the log files to a location outside the web application -->
<file value="App_Data\EPiServerErrors.log"/>
<encoding value="utf-8"/>
<staticLogFileName value="true"/>
<datePattern value=".yyyyMMdd.'log'"/>
<rollingStyle value="Date"/>
<lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
<appendToFile value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %level %logger: %message%n"/>
</layout>
</appender>
</log4net>