Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.0.14
-
None
-
None
Description
Version:
log4net 2.0.15
Problematic code:
https://github.com/apache/logging-log4net/blob/master/src/log4net/Core/LoggingEvent.cs
public string ThreadName { get { if (m_data.ThreadName == null && this.m_cacheUpdatable) { #if NETCF // Get thread ID only m_data.ThreadName = SystemInfo.CurrentThreadId.ToString(System.Globalization.NumberFormatInfo.InvariantInfo); #else // '.NET ThreadPool Worker' appears as a default thread pool name in .NET 6+. // Prefer the numeric thread ID instead. string threadName = System.Threading.Thread.CurrentThread.Name; if (!string.IsNullOrEmpty(threadName) && threadName != ".NET ThreadPool Worker") { m_data.ThreadName = threadName; }
In .NET 8 the threads from thread pool have new name: ".NET TP Worker".
So probably additional condition in this code is required:
if (!string.IsNullOrEmpty(threadName) && threadName != ".NET ThreadPool Worker" && threadName != ".NET TP Worker")