You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by "FreeAndNil (via GitHub)" <gi...@apache.org> on 2025/08/22 08:12:05 UTC

[D] Poll: Dropping net462 Support in log4net [logging-log4net]

GitHub user FreeAndNil created a discussion: Poll: Dropping net462 Support in log4net

With the recent changes in the Mono Project and the removal of Mono from GitHub Actions macOS images, we are considering **dropping support for `net462`** in log4net.  

---

## Background
- The Mono Project has transitioned stewardship to WineHQ. However, upstream maintenance is minimal, and binary releases are no longer being produced.  
  - [Mono announcement](https://www.mono-project.com/download/stable/)  
- GitHub Actions has removed Mono from the macOS-15 images due to maintenance reasons.  
  - [actions/runner-images#12520](https://github.com/actions/runner-images/issues/12520)  
- As a result, continued support for `net462` across Linux and macOS is becoming impractical.  

---

## Proposed change
- Drop support for `net462`.  
- Continue to support **`netstandard2.0`**, which works with:  
  - .NET Framework 4.7.1 and higher  
  - .NET 8 and higher  

---

## Impact
The following appenders would be removed since they are not compatible with `netstandard`:  

- `AspNetTraceAppender`  
- `EventLogAppender`  

---

## Request for feedback
We’d like to hear from the community, especially developers who:  

- Still rely on `net462` support  
- Use the appenders mentioned above  
- Have concerns about migrating to newer .NET versions  

Your input will help us evaluate whether this change is reasonable for the next release of log4net.  


GitHub link: https://github.com/apache/logging-log4net/discussions/267

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

@WolfgangHG technically this is absolutely possible.

BUT ;-)

That would mean we need to support
- .netstandard2.0 (for users with net4x and < net8)
- net8/10 (to support AOT and modern features like interpolation handlers)
- net8/10-windows (for the windows guys)
- when transitioning from one LTS to another: net12+net12-windows on top
That all within one package leads to many #ifdefs or polyfills.

We had that situation already in log4net v2 (with net20;net35;net40;net40-client;net45;netstandard1.3;netstandard2.0).
In 2024 only @fluffynuts was able to build those binaries ;-)

We like to keep it simple and put those Windows only appenders into their own package which then would only support net10-windows - no #ifdef, no polyfill - easy.

All you would need to do, is add the new package and fully qualify the appender name in the config (like https://logging.apache.org/log4net/manual/configuration/appenders/smtpappender.html#mailkit-smtpappender).

Would that work for you?

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-18664453

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

@alexey-leonovich just to be clear we dont "use [System.Diagnostics.EventLog](https://www.nuget.org/packages/system.diagnostics.eventlog/) nuget under the hood".
In net4 System.Diagnostics.EventLog is part of the framework, while it is no longer a part of .net8 or .net10.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-16989559

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "fluffynuts (via GitHub)" <gi...@apache.org>.
GitHub user fluffynuts added a comment to the discussion: Poll: Dropping net462 Support in log4net

Hi @alexey-leonovich 

My initial feel is that maintenance is one of the hurdles - I personally haven't used windows in a very long time - no need with modern dotnet. Honestly, the best course of action in my opinion is that EventLogAppender ends up in a separate nuget package somewhere - whether you or someone at apache, or someone else in the community does it. The source is obviously still available, so even if you just wanted to rip the source and copy the class into your project, that is a way. I can't personally guarantee testing or validity - and, from the original post, net462 support via Mono isn't guaranteed going forward. @FreeAndNil what do you think?

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-16988164

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "fluffynuts (via GitHub)" <gi...@apache.org>.
GitHub user fluffynuts added a comment to the discussion: Poll: Dropping net462 Support in log4net

I don't have a problem with removing net462 support, but it might be worthwhile to do a major version increment at the same time, to prevent someone with a legacy system from accidentally upgrading to a non-supported package, and to make it clear that there's a major breaking change (especially with removal of appenders)

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-14187617

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil edited a discussion: Poll: Dropping net462 Support in log4net

With the recent changes in the Mono Project and the removal of Mono from GitHub Actions macOS images, we are considering **dropping support for `net462`** in log4net.  

---

## Background
- The Mono Project has transitioned stewardship to WineHQ. However, upstream maintenance is minimal, and binary releases are no longer being produced.  
  - [Mono announcement](https://www.mono-project.com/download/stable/)  
- GitHub Actions has removed Mono from the macOS-15 images due to maintenance reasons.  
  - [actions/runner-images#12520](https://github.com/actions/runner-images/issues/12520)  
- As a result, continued support for `net462` across Linux and macOS is becoming impractical.  

---

## Proposed change
- Drop support for `net462`.  
- Continue to support **`netstandard2.0`**, which works with:  
  - .NET Framework 4.7.1 and higher  
  - .NET 8 and higher  

---

## Impact
The following appenders would be removed since they are not compatible with `netstandard`:  

- `AspNetTraceAppender`  
- `EventLogAppender`  

---

## Request for feedback
We’d like to hear from the community, especially developers who:  

- Still rely on `net462` support  
- Use the appenders mentioned above  
- Have concerns about migrating to newer .NET versions  

Your input will help us evaluate whether this change is reasonable for the next major release of log4net.  


GitHub link: https://github.com/apache/logging-log4net/discussions/267

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

MS drops Mono completely:
https://devblogs.microsoft.com/dotnet/coreclr-progress-and-mono-timeline-dotnet-maui/

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-17640062

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

@alexey-leonovich @fluffynuts @gdziadkiewicz I agree.
What do you think about log4net.Ext.Legacy or log4net.Ext.Windows as our Bad Bank for such stuff?

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-17003856

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

Thanks for the feedback. It's always good to know what your users want ;-)
We will plan it this way.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-18664838

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "alexey-leonovich (via GitHub)" <gi...@apache.org>.
GitHub user alexey-leonovich added a comment to the discussion: Poll: Dropping net462 Support in log4net

We are using `EventLogAppender` on Windows in net472 application to log fatal errors as an addition to file logging. Logging to the Windows event log can also be useful for automated systems that collect and analyze such logs.
Why not to target only `netstandard20` but keep `EventLogAppender` on Windows? You are using [System.Diagnostics.EventLog](https://www.nuget.org/packages/system.diagnostics.eventlog/) nuget under the hood, right? It will throw `System.PlatformNotSupportedException: EventLog access is not supported on this platform` the you can catch and transform it to warning similar to existing now (and harmless):
>  [2026-05-19 14:46:08,911] DEBUG [10] [LogLog:EmitErrorLine] - log4net:ERROR Could not create Appender [EventLogAppender] of type [log4net.Appender.EventLogAppender]. Reported error follows.
> [2026-05-19 14:46:09,052] DEBUG [10] [LogLog:EmitErrorLine] - System.TypeLoadException: Could not load type [log4net.Appender.EventLogAppender]. Tried assembly [log4net, Version=2.0.17.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a] and all loaded assemblies
>    at log4net.Util.SystemInfo.GetTypeFromString(Assembly relativeAssembly, String typeName, Boolean throwOnError, Boolean ignoreCase)
>    at log4net.Util.SystemInfo.GetTypeFromString(String typeName, Boolean throwOnError, Boolean ignoreCase)
>    at log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement appenderElement)

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-16987402

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "WolfgangHG (via GitHub)" <gi...@apache.org>.
GitHub user WolfgangHG added a comment to the discussion: Poll: Dropping net462 Support in log4net

Just a thought about `EventLogAppender`: currently, the workaround is to use another nuget package, but the source repository of [Log4Net.Appenders.NetCore](https://www.nuget.org/packages/Log4Net.Appenders.NetCore) does not even exist any more. 

The .NET framework `log4net.Appender.EventLogAppender` should probably work also for NET8 if the log4net Nuget package contains also an assembly for the target framework `net8.0-windows`. This way, the `EventLogAppender` would be available only for applications target a windows system. Would it be possible to add this additional target framework to "log4net.csproj", or would this break your build process?

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-18655979

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil edited a comment on the discussion: Poll: Dropping net462 Support in log4net

I fully agree - I changed the text above to:

> Your input will help us evaluate whether this change is reasonable for the next ***major*** release of log4net.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-14187731

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "fluffynuts (via GitHub)" <gi...@apache.org>.
GitHub user fluffynuts added a comment to the discussion: Poll: Dropping net462 Support in log4net

One problem I've definitely experienced is that when you depend on some other package, you have to sometimes do maintenance releases just to upgrade the dependency. Yes, the consumer can override the dependency with a local install (assuming that it's still compatible), but most people don't. So then when a vulnerability is found in an upstream package, one finds oneself repackaging and re-releasing out of an obligation to the users (and also to stop silly vulnerability reports like "you depend on vulnerable package X at version Y" - again, the user can override this, but many won't, so the report has some validity). I would much rather see a new nuget package for the appender (and that could depend on the System.Diagnostics.EventLog package - it would have a much smaller scope than all of log4net, and likely wouldn't incur the same overhead on a release - apart from the act of bumping versions and re-packaging, the whole thing has to go through a vote as well).

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-17000052

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

I fully agree (I changed the text above to 

> Your input will help us evaluate whether this change is reasonable for the next ***major*** release of log4net.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-14187731

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "FreeAndNil (via GitHub)" <gi...@apache.org>.
GitHub user FreeAndNil added a comment to the discussion: Poll: Dropping net462 Support in log4net

Hi @alexey-leonovich ,

I agree with @fluffynuts - a separate NuGet package is the cleanest path forward.

If you or someone in the community wants to take that on, the existing `EventLogAppender` source is a solid starting point. We are happy to review a PR if you want to keep it under the Apache umbrella, or you can publish it independently.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-16988881

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "alexey-leonovich (via GitHub)" <gi...@apache.org>.
GitHub user alexey-leonovich added a comment to the discussion: Poll: Dropping net462 Support in log4net

I think log4net.Ext.Windows is clearer to understand.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-17004328

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "fluffynuts (via GitHub)" <gi...@apache.org>.
GitHub user fluffynuts edited a comment on the discussion: Poll: Dropping net462 Support in log4net

I don't have a problem with removing net462 support, but it might be worthwhile to do a major version increment at the same time, to prevent someone with a legacy system from accidentally upgrading to a non-supported package, and to make it clear that there's a major breaking change (especially with removal of appenders). Also, that would conform to semver - breaking changes should require a new major version.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-14187617

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "alexey-leonovich (via GitHub)" <gi...@apache.org>.
GitHub user alexey-leonovich added a comment to the discussion: Poll: Dropping net462 Support in log4net

I meant you could use [System.Diagnostics.EventLog](https://www.nuget.org/packages/system.diagnostics.eventlog/) nuget in `netstandard20` log4net. But you don't have such plans as I see now.

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-16999812

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org


Re: [D] Poll: Dropping net462 Support in log4net [logging-log4net]

Posted by "WolfgangHG (via GitHub)" <gi...@apache.org>.
GitHub user WolfgangHG added a comment to the discussion: Poll: Dropping net462 Support in log4net

@FreeAndNil Of course, another package is also fine - I already have to handle it this way. It will be an improvement anyway to have an officially supported ´EventLogAppender`. 

GitHub link: https://github.com/apache/logging-log4net/discussions/267#discussioncomment-18664713

----
This is an automatically sent email for dev@logging.apache.org.
To unsubscribe, please send an email to: dev-unsubscribe@logging.apache.org