You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "mordio (via GitHub)" <gi...@apache.org> on 2025/06/25 09:21:01 UTC
[I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
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: notifications-unsubscribe@logging.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3215666723
@mordio log4net 3.2.0 has been released
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil closed issue #260: v3.1.0 does not allow empty file names anymore for RollingFileAppender
URL: https://github.com/apache/logging-log4net/issues/260
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "mordio (via GitHub)" <gi...@apache.org>.
mordio commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3035269839
> [@mordio](https://github.com/mordio) can you test with https://github.com/apache/logging-log4net/releases/tag/rc%2F3.2.0-preview.1 ?
I can confirm that it works again with setting `<file value="logs\"/>` . Thanks!
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "gdziadkiewicz (via GitHub)" <gi...@apache.org>.
gdziadkiewicz commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3005330005
Yes, will add it to tests and fix
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3031620753
@mordio can you test with https://github.com/apache/logging-log4net/releases/tag/rc%2F3.2.0-preview.1 ?
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "mordio (via GitHub)" <gi...@apache.org>.
mordio commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3069116897
FYI: I am using `.NET Framework v4.8` for the project using log4net. So I can confirm it works for that version.
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "gdziadkiewicz (via GitHub)" <gi...@apache.org>.
gdziadkiewicz commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3005457581
It is the same issue as in #244, which was fixed in #251. I'm still adding the test to prevent regression in the future.
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
FreeAndNil commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3004074908
@gdziadkiewicz this seems related to #257 - can you take a look?
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] v3.1.0 does not allow empty file names anymore for RollingFileAppender (logging-log4net)
Posted by "ringchenhao (via GitHub)" <gi...@apache.org>.
ringchenhao commented on issue #260:
URL: https://github.com/apache/logging-log4net/issues/260#issuecomment-3055976305
i have faced the same problem with mordio, it is ok with the platform .net 8.0, but with platform .net 4.6.2, it shows the same error print like mordio
--
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-unsubscribe@logging.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org