mordio opened a new issue, #260:
URL: https://github.com/apache/logging-log4net/issues/260

   This works until `v3.0.4`:
   
   ```xml
   <appender name="RollingFileAppender" 
type="log4net.Appender.RollingFileAppender">
     <lockingModel type="log4net.Appender.FileAppender+MinimalLock"/>
     <file value="logs\"/>
     <encoding value="utf-8" />
     <datePattern value="yyyy-MM-dd'.log'"/>
     <staticLogFileName value="false"/>
     <appendToFile value="true"/>
     <rollingStyle value="Composite"/>
     <maxSizeRollBackups value="10"/>
     <maximumFileSize value="5MB"/>
     <layout type="log4net.Layout.PatternLayout">
       <conversionPattern value="%date [%property{id}] %-5level %logger - 
%message%newline"/>
     </layout>
   </appender>
   ```
   
   It creates log files in the subdirectory `logs` with names consisting of the 
date + `.log` like `logs\2025-06-25.log`.
   
   With `v3.1.0` an `System.ArgumentException: The path is not of a legal 
form.` is thrown:
   
   
   ```
   log4net:ERROR Could not create Appender [RollingFileAppender] of type 
[log4net.Appender.RollingFileAppender]. Reported error follows.
   System.ArgumentException: The path is not of a legal form.
      at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 
maxPathLength, Boolean expandShortPaths)
      at System.IO.Path.InternalGetDirectoryName(String path)
      at log4net.Appender.RollingFileAppender.InitializeFromOneFile(String 
baseFile, String curFileName)
      at log4net.Appender.RollingFileAppender.InitializeRollBackups(String 
baseFile, IList`1 arrayFiles)
      at log4net.Appender.RollingFileAppender.DetermineCurSizeRollBackups()
      at log4net.Appender.RollingFileAppender.ExistingInit()
      at log4net.Appender.RollingFileAppender.ActivateOptions()
      at 
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement 
appenderElement)
   log4net:ERROR Appender named [RollingFileAppender] not found.
   ```
   
   Workaround is to set `<file>` to something like `<file value="logs\log_"/>` 
and it creates `logs\log_2025-06-25.log`. Is there any way to produce file 
names like before?
   
   Thanks for the good work!


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to