dotnet / dotnet/msbuild

Log.LogErrorFromException does not log stack trace

Open
#3,964 0 comments 0 reactions 0 assignees View on GitHub
Area: Debuggability triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 13h
Merged PRs (30d)
133

Description

https://github.com/Microsoft/msbuild/blob/701ed49b20b860c17bcfd62d4e7845647a590760/src/Shared/TaskLoggingHelper.cs#L813-L816

This seems like a surprising default, since it makes the common thing:

```c#
class Foo : Task
{
public bool Execute()
{
try
{
...
}
catch (Exception e)
{
Log.LogErrorFromException(e);
}
}
}
```

drop a ton of potentially-useful information.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading src/Shared/TaskLoggingHelper.cs at lines 813-816, linked in the issue, and inspect how LogErrorFromException handles the caught exception. Reproduce the shown Task pattern and verify the expected log output includes the stack trace; done means the common overload no longer drops that information.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.