WorldRobertProject commented on issue #163:
URL: 
https://github.com/apache/logging-log4net/issues/163#issuecomment-2791434238

   Here is the setting which reproduces the issue.
   
   ```
   <?xml version="1.0" encoding="utf-8" ?>
   <configuration>
     <log4net>
       <appender name="LogFileAppender" 
type="log4net.Appender.RollingFileAppender">
         <param name="File" value=".\Log\.log" />
         <param name="AppendToFile" value="true" />
         <param name="RollingStyle" value="Composite" />
         <param name="DatePattern" value="yyyy-MM-dd" />
         <param name="MaximumFileSize" value="3MB" />
         <param name="MaxSizeRollBackups" value="3" />
         <param name="StaticLogFileName" value="false" />
         <param name="CountDirection" value="1" />
         <param name="PreserveLogFileNameExtension" value="true"/>
         <lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
         <layout type="log4net.Layout.PatternLayout">
           <param name="ConversionPattern" value="%d{yyyy/MM/dd HH:mm:ss.fff} 
[%-5p] %m (%M)%n"/>
         </layout>
       </appender>
   
       <logger name="log">
         <level value="debug" />
         <appender-ref ref="LogFileAppender" />
       </logger>
     </log4net>
   </configuration>
   ```
   
   Here is the test code.
   
   ```
   using log4net;
   using log4net.Config;
   using System;
   using System.IO;
   using System.Reflection;
   
   namespace TestLog4net
   {
       class Program
       {
           private static void Main()
           {
               var pathConfig = 
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "log4net.config.xml");
               XmlConfigurator.Configure(new FileInfo(pathConfig));
   
               var assembly = Assembly.GetEntryAssembly();
               var logger = LogManager.GetLogger(assembly, "log");
   
               logger.Info("Hello, log4net!");
           }
       }
   }
   ```
   
   We prepared the following three log files:
   - 2025-04-10.0.log (4.10 MB)
   - 2025-04-10.1.log (4.10 MB)
   - 2025-04-10.2.log (4.10 MB)
   
   After we executed the test code, 2025-04-10.1.log was truncated and 
overwritten.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@logging.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to