Summary
GlobalToolLog writes daily log files named with DateTime.UtcNow:yyyyMMdd and uses FileMode.Append with AutoFlush=true. Two CodeIndex processes started on the same day will both write to the same file with no coordination — interleaved bytes, partial lines on Windows where atomic-append is not guaranteed across processes, and no way after-the-fact to tell which process emitted which line.
Where
src/CodeIndex/Cli/GlobalToolLog.cs:24 (file naming)
src/CodeIndex/Cli/GlobalToolLog.cs:29 (append mode)
Suggested approach
Append a process-suffix (PID + short start-time) to the filename, OR include PID and a per-process counter in every log line, OR use a single-writer lock with file rotation. PID-suffixed daily files (stderr-20260512-12345.log) are the cheapest reliable fix.
Summary
GlobalToolLogwrites daily log files named withDateTime.UtcNow:yyyyMMddand usesFileMode.AppendwithAutoFlush=true. Two CodeIndex processes started on the same day will both write to the same file with no coordination — interleaved bytes, partial lines on Windows where atomic-append is not guaranteed across processes, and no way after-the-fact to tell which process emitted which line.Where
src/CodeIndex/Cli/GlobalToolLog.cs:24(file naming)src/CodeIndex/Cli/GlobalToolLog.cs:29(append mode)Suggested approach
Append a process-suffix (PID + short start-time) to the filename, OR include PID and a per-process counter in every log line, OR use a single-writer lock with file rotation. PID-suffixed daily files (
stderr-20260512-12345.log) are the cheapest reliable fix.