Configure the log file size

Version: 10.4

When you have enabled the extended xConnect logging feature, the size of log files can grow dramatically. It can affect the overall xConnect performance and slow it down. We recommend that you configure the maximum size of log files to avoid slow xConnect performance. xConnect automatically creates new log files when it reaches the file size limit.

To configure the maximum size of log files:

  • Open the \App_Data\config\Sitecore\CoreServices\sc.Serilog.xml file and add the following nodes under the Settings/Serilog/WriteTo/FileSink/Args section:

    RequestResponse
    <rollingInterval>Day</rollingInterval>
    <rollOnFileSizeLimit>True</rollOnFileSizeLimit>
    <fileSizeLimitBytes>52428800</fileSizeLimitBytes>

    For example:

    RequestResponse
    <WriteTo>
        <FileSink>
            <Name>RollingFile</Name>
            <Args>
                <pathFormat>App_Data\\Logs\\xconnect-log-${MachineName}-${InstanceName}-{Date}.txt</pathFormat>
                <retainedFileCountLimit>7</retainedFileCountLimit>
                <buffered>False</buffered>
                <rollingInterval>Day</rollingInterval>
                <rollOnFileSizeLimit>True</rollOnFileSizeLimit>
                <fileSizeLimitBytes>52428800</fileSizeLimitBytes>
            </Args>
        </FileSink>
    </WriteTo> 

Do you have some feedback for us?

If you have suggestions for improving this article,