I had to do some digging to configure the regular logs to ignore my custom messages, so I'm writing this in the hopes that I might save someone else the digging.
I ended up adding a filter to the LogFileAppender that would deny messages containing my custom string. The message would be denied on match.
<appender name="LogFileAppender" type="log4net.Appender.SitecoreLogFileAppender, Sitecore.Logging">
<file value="$(dataFolder)/logs/log.{date}.txt"/>
<filter type="log4net.Filter.StringMatchFilter">
<stringToMatch value="YOUR_CUSTOM_STRING" />
<acceptOnMatch value="false" />
</filter>
<appendToFile value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%4t %d{ABSOLUTE} %-5p %m%n"/>
</layout>
</appender>
No comments:
Post a Comment