Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In .NET 6, thread ID in agent log shows generic name instead of numeric thread ID #600

Closed
nr-ahemsath opened this issue Jun 8, 2021 · 0 comments · Fixed by #626
Closed
Assignees
Labels
bug Something isn't working

Comments

@nr-ahemsath
Copy link
Member

When running the agent attached to a .NET 6 Preview application, the agent's log file shows messages like this:

“NewRelic FINEST: [pid: 24300, tid: .NET ThreadPool Worker]” instead of having the tid field be a numeric thread ID as it currently is in all other .NET runtimes. We're assuming this is because the .NET threadpool is re-implemented in managed code in .NET 6.

More specifically, our Log4Net logging template uses the %thread formatting directive. Under the covers, Log4Net first tries to get the thread's name and then falls back to getting the numeric thread ID if no name is set. Apparently pre-.NET 6 the threadpool threads were not named by default, and in .NET 6 they will be. See this SO discussion for more context and a possible solution: https://stackoverflow.com/questions/42675024/log4net-printing-threadid-and-thread-name-in-the-log/44112461

@nr-ahemsath nr-ahemsath added the bug Something isn't working label Jun 8, 2021
@nr-ahemsath nr-ahemsath added this to the .NET 6 Preview 4 Testing milestone Jun 8, 2021
@JcolemanNR JcolemanNR self-assigned this Jun 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants