I have a WCF service and want to enable logging. As described in Microsoft's documentation [Configuring Message Logging](https://docs.microsoft.com/en-us/dotnet/framework/wcf/diagnostics/configuring-message-logging#feedback), I put in the Web.config the following:
- <system.diagnostics>    
-   <sources>    
-     <source name="System.ServiceModel.MessageLogging">    
-       <listeners>    
-          <add name="messages"    
-               type="System.Diagnostics.XmlWriterTraceListener"    
-               initializeData="c:\logs\messages.svclog" />    
-         </listeners>    
-     </source>    
-   </sources>    
- </system.diagnostics>    
-     
- <system.serviceModel>    
-   <diagnostics>    
-     <messageLogging     
-          logEntireMessage="true"     
-          logMalformedMessages="false"    
-          logMessagesAtServiceLevel="true"     
-          logMessagesAtTransportLevel="false"    
-          maxMessagesToLog="3000"    
-          maxSizeOfMessageToLog="2000"/>    
-   </diagnostics>    
- </system.serviceModel>    
How can I rotate the log, for example write to messages1.svclog, then messages2.svclog, etc. when the number of messages in the last log has reached maxMessagesToLog=3000?
I read the article [A Rolling XmlWriterTraceListener](https://www.codeproject.com/Articles/30956/A-Rolling-XmlWriterTraceListener), but this rotates the log file when a certain file size has been reached. However, when the number of messages reaches maxMessagesToLog, WCF will stop logging.