Sitecore Audit Logs Stored in File
Sitecore captures all the logs in txt files using log4net and it will not be easy to find audit logs to track the changes on items.
To overcome this, we can write a patch config to capture only Audit logs in a separate file to track the changes on items.
Capture Audit Logs
Here are the steps to capture the Audit only logs
Add a custom folder in App_Data/logs folder
Create a new patch config file and add it to App_Config/Include/z_xxx folder
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<log4net>
<appender name="CustomLogFileAppender" type="log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging">
<file value="$(dataFolder)/logs/CustomAudit/Custom.Audit.Log.{date}.txt" />
<filter type="log4net.Filter.StringMatchFilter">
<stringToMatch value="AUDIT" />
<acceptOnMatch value="true" />
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<appendToFile value="true" />
<rollingStyle value="Date" />
<maxSizeRollBackups value="-1" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d{yyyy-MM-dd HH:mm:ss.fff} %-5p %m%n" />
</layout>
<encoding value="utf-8" />
</appender>
<root>
<priority value="INFO" />
<appender-ref ref="CustomLogFileAppender" />
</root>
<logger name="CustomLogFileAppender" additivity="false">
<level value="INFO" />
<appender-ref ref="CustomLogFileAppender" />
</logger>
</log4net>
</sitecore>
</configuration>
A file with the name “Custom.Audit.Log.{Date}” will be created on restart of the Sitecore CM instance

Open Sitecore CM Instance and edit one of the items and Click Save
Go back to the logs folder and open the “Custom.Audit.Log.{Date}” log file and Verify that the Audit entry is stored.
