apache / logging-log4net Goto Github PK
View Code? Open in Web Editor NEWApache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET
Home Page: https://logging.apache.org/log4net
License: Apache License 2.0
Apache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET
Home Page: https://logging.apache.org/log4net
License: Apache License 2.0
Provide the following convenience for PMC members to review the project:
git checkout <release-tag>
docker build -t log4net-builder .
docker run log4net-builder
That is, a convenience to
build a Docker image containing all necessary dependencies to be able to build the project
an entry point to build the project using the created Docker image.
Proposed by @vy
Log4net supports a lot of really old runtimes, including net2.0 and net3.5 CE (Compact Edition) which can be notoriously difficult to install on windows (I've been lucky and unlucky - today, it "just worked" without intervention, but previously, I've crafted the included powershell scripts to install .net framework 3.5.
These targets make it impossible (as far as I know, and I've tried) to build on non-windows hosts. However, if we could reduce the targeted runtime list to:
then we could support all supported versions of .net (at time of writing, the lowest supported netfx version is 4.6.2) because we can use Mono on non-windows hosts to provide the api to compile system functionality against (see MonoForFramework.targets)
Apart from quicker builds & testing times, this would be highly beneficial in that it would make contributing to log4net much easier.
On one hand, I'd really like to maintain as much compatibility as possible, but on the other, I'd like to remove hurdles for prospective devs (and myself ๐ )
I have revamped the Download, Support, and Security pages of Logging Services (LS) such that they now cover all LS projects. In the Log4j website, I have wired all associated links to there and I have replaced all overlapping content to point to there. Would you consider implementing the following changes for the left menu of the Log4net website?
Log4Net can log to multiple backends, including multiple database backends. I've seen a situation before where a patch to improve performance for postgresql negatively impacted mssql users (something to do with parameter initialisation). To this end, we should have a github action which runs log4net against multiple database backends and verifies that the results are correct for both, perhaps also recording timings and referring to expected timings to raise flags about any massive change in runtime.
After upgrading to ASP.NET core 8, the logs using the property %thread print a generic thread name instead of the thread ID.
The commit ab74a0a seems to be related to a fix for the issue. Is there any timeline/date for when this will be release?
Beta nuget packages have a version appendage, eg -r1
, or the more descriptive -{datestamp}-{commit_sha}
; zarro
already supports generating packages in this format, so actually producing the artifact shouldn't be that hard. However, the artifact should also be pushed to a repository somewhere - either to nuget (least surprise for users) or GitHub (to keep them separate from official releases, if that's even a desirable thing).
Ideally, we should produce a beta package any time code is pushed to GitHub in this repo so that it can be tested in consuming projects - and hopefully if we're making changes to resolve issues, we could point a user at a beta package to verify that the issue has indeed been resolved.
*** I have raised an issue with both Xamarin.Forms and Log4net as ambiguity where the issue lies***
Log4net 2.0.15
Xamarin.Forms 5.0.0.2622
Android 14.0 (34)
VS 2022 17.8.4
This seems to only occur since updating to Android 14.0.
When archiving the project The following error is thrown:
Severity Code Description Project File Line Suppression State Details Error Mono.Linker.OutputException: Failed to write 'Xamarin.Android.Project\obj\Release\130\android\assets\log4net.dll ---> System.IO.IOException: The process cannot access the file 'Xamarin.Android.Project\obj\Release\130\android\assets\log4net.dll' because it is being used by another process. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at Mono.Cecil.ModuleDefinition.Write(String fileName, WriterParameters parameters) in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/external/cecil/Mono.Cecil/ModuleDefinition.cs:line 1160 at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters) --- End of inner exception stack trace --- at Mono.Linker.Steps.OutputStep.WriteAssembly(AssemblyDefinition assembly, String directory, WriterParameters writerParameters) at Mono.Linker.Steps.OutputStep.OutputAssembly(AssemblyDefinition assembly) at Mono.Linker.Steps.BaseStep.Process(LinkContext context) at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) at Xamarin.Android.Tasks.LinkAssemblies.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 Lexacom.Mahon.Xamarin.Android
Any help or clarification of what is going wrong would be appreciated.
This commit introduced after 2.0.15 results in an NRE during some shutdown cases where m_lockingModel is null during Close/Dispose.
The simplistic fix is to add a check to FileAppender. The better fix is to enable nullability on FileAppender, RollingFileAppender, and their unit tests, and fix all nullability problems.
A fix is needed as a 2.0.17 package in addition to the proposed 3.0 package.
The RELEASING.md document attempts to layout each and every step, in order, that is required to get log4net updates to the users.
There are a lot of steps, but we can break the process up into a few sections where some could be automated:
npm run prepare-release
-> would do steps 2-12 of the linked RELEASING.md documentnpm run publish-release
-> would do steps 16-19, once the vote has passedbuild logic can be written in typescript or javascript, by adding gulp-style tasks in files under local-tasks
(see existing tasks under that folder; tasks are run by zarro and I'm always happy to assist with this. To see a new shell task, run npm run zarro -- -- --create-task
(the two --
's are required to get past npm's argument handlers and pass on to zarro)
[Disclaimer: I am not a .NET developer. Apologies in advance if I say something nonsense.]
Currently, in the Log4Net website, I am not able to quickly answer the following questions:
I suggest to update the current website as follows:
Installation
page addressing the above questions to quickly get users startedDownload
page (currently the Download
link in the left menu points to the Logging Services Download page), similar to the one Log4j has, containing two bullets:
There are numerous parts of the code that are marked with [Obsolete] attributes. Additionally there is code that may or may not any longer be in use, such as NDC (src/log4net/NDC.cs). Ideally with the major version change the deprecations should be removed.
It would be highly beneficial to the project to have automatic test runs (npm test
) for every commit. To this end, a GitHub action that (eventually) invokes npm test
would be fantastic.
This is where we are told the documentation is:
https://logging.apache.org/log4net/
All the top level links work, but as soon as you click through to a second level, the link is broken e.g.
https://logging.apache.org/log4net/release/sdk/index.html
We're using Log4Net (2.0.15.0-.NET 4.5) in WCF services hosted in IIS. On our production environments from time to times we're experiencing crash of the application pool with following error:
Exception: System.IndexOutOfRangeException
Message: Index was outside the bounds of the array.
StackTrace: at System.Collections.ArrayList.Add(Object value)
at log4net.Util.LogReceivedEventHandler.Invoke(Object source, LogReceivedEventArgs e)
at log4net.Util.LogLog.OnLogReceived(Type source, String prefix, String message, Exception exception)
at log4net.Util.LogLog.Debug(Type source, String message)
at log4net.Appender.AppenderSkeleton.Finalize()
So it seems the LogLog.Debug statement in the finalize method can fail in some circumstances...
I was using the package in .net7.0 without problems. However, after updating to .net8.0, my program throws error. When I unchecked the trimming unused code option, there was no error, but it increases output file size very much. How can I solve it?
Public classes and interfaces should get nullable annotations so that callers will be warned when passing null values.
log4net.Appender.AppenderCollection.IAppenderCollectionEnumerator
is now obsolete and must be replaced by IEnumerator<IAppender>
log4net.Appender.MemoryAppender.m_eventsList
(protected field) was changed from ArrayList
to List<LoggingEvent>
m_eventsList.SyncRoot
you need to cast it: ((ICollection)m_eventsList).SyncRoot
Issue for preparing the first preview of 3.0.0
If you run npm run run-dotnet-core-tests
, the test assembly should be run with dotnet
instead of the nunit runner. This should be used to verify that cross-framework code works as expected. Unfortunately, at the moment, it looks like doing this doesn't pick up any tests - this requires some investigation.
Ultimately, we should move away from the nunit-console -based run to running via dotnet
for all targets. The first step would be getting this script (run-dotnet-core-tests
) to work as expected.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.