Skip to content

Per-day stderr log file shared across concurrent processes; no per-process suffix #1619

Description

@Widthdom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions