Can log4net filter and replace matched log message?
<filter type="log4net.Filter.StringMatchFilter">
<param name="AcceptOnMatch" value="false" />
<param name="RegexToMatch" value="<Code>.*</Code>" />
</filter>
This code can match the …content…of Code and not to write all message to file.
But, what I want is that save the message, and replace the content of Code with empty.
Thanks.
Never heard of such functionality in bundled filters.
You’ll probably have to do the job yourself by subclassing log4Net.Filter.FilterSkeleton or StringMatchFilter.
Then in your XML, you’ll only have to call