Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/log4net/Core/LoggingEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -737,9 +737,10 @@ public string ThreadName
SystemInfo.CurrentThreadId.ToString(System.Globalization.NumberFormatInfo.InvariantInfo);
#else
// '.NET ThreadPool Worker' appears as a default thread pool name in .NET 6+.
// '.NET TP Worker' appears as a default thread pool name in .NET 8+.
// Prefer the numeric thread ID instead.
string threadName = System.Threading.Thread.CurrentThread.Name;
if (!string.IsNullOrEmpty(threadName) && threadName != ".NET ThreadPool Worker")
if (!string.IsNullOrEmpty(threadName) && threadName != ".NET ThreadPool Worker" && threadName != ".NET TP Worker")
{
m_data.ThreadName = threadName;
}
Expand Down