Skip to content

Persistent stderr logging should cap per-write mirror output #3166

Description

@Widthdom

Problem

Global persistent logging chooses a log file based on its size at session start, but mirrored stderr writes can append arbitrarily large strings. A single huge stderr write can therefore overshoot the configured max log size before the next session rotates.

Evidence

  • GlobalToolLog.ResolveLogPath selects a file whose current size is below the configured max.
  • TeeTextWriter.Write / WriteLine forwards the full value to the secondary log writer without per-write truncation or rotation.

Suggested fix

Add per-write truncation for mirrored stderr, or check/rotate the log writer before large writes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions