Skip to content

Commit 55071a8

Browse files
committed
Set logging env for tracee
1 parent 31eac0f commit 55071a8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/tests/tracing/eventpipe/userevents/userevents.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,18 @@ public static int TestEntryPoint()
9696
traceeStartInfo.RedirectStandardOutput = true;
9797
traceeStartInfo.RedirectStandardError = true;
9898

99+
string logDirectory = helixWorkItemDirectory != null && Directory.Exists(helixWorkItemDirectory)
100+
? helixWorkItemDirectory
101+
: appBaseDir;
102+
string logFilePath = Path.Combine(logDirectory, "userevents.log");
103+
104+
traceeStartInfo.Environment["DOTNET_LogEnable"] = "1";
105+
traceeStartInfo.Environment["DOTNET_LogFacility"] = "0x00001000";
106+
traceeStartInfo.Environment["DOTNET_LogLevel"] = "4";
107+
traceeStartInfo.Environment["DOTNET_LogToFile"] = "1";
108+
traceeStartInfo.Environment["DOTNET_LogFile"] = logFilePath;
109+
traceeStartInfo.Environment["DOTNET_LogWithPid"] = "1";
110+
99111
Console.WriteLine($"Starting tracee process: {traceeStartInfo.FileName} {traceeStartInfo.Arguments}");
100112
using Process traceeProcess = Process.Start(traceeStartInfo);
101113
Console.WriteLine($"Tracee process started with PID: {traceeProcess.Id}");

0 commit comments

Comments
 (0)