Skip to content

fix(observability): use platform-correct log directories and atomic writes#3

Merged
claylo merged 1 commit intomainfrom
chore/update-template
Apr 5, 2026
Merged

fix(observability): use platform-correct log directories and atomic writes#3
claylo merged 1 commit intomainfrom
chore/update-template

Conversation

@claylo
Copy link
Copy Markdown
Owner

@claylo claylo commented Apr 5, 2026

Logs were landing in XDG-style paths on macOS instead of
~/Library/Logs/. Replace the generic ProjectDirs fallback with
platform_log_dir() that resolves correctly per OS:
macOS ~/Library/Logs/, Linux $XDG_STATE_HOME, Windows LocalAppData.
Also buffer each JSON log line into a single write() syscall so
concurrent O_APPEND writers can't interleave partial lines.
Accept service name as a caller parameter in from_env_with_overrides
instead of hard-coding CARGO_PKG_NAME at compile time. Isolate
integration tests from production log paths via env var override.
Release-Note: Fix log files writing to wrong directory on macOS
Release-Impact: medium

…rites

Logs were landing in XDG-style paths on macOS instead of
~/Library/Logs/. Replace the generic ProjectDirs fallback with
platform_log_dir() that resolves correctly per OS:
macOS ~/Library/Logs/, Linux $XDG_STATE_HOME, Windows LocalAppData.

Also buffer each JSON log line into a single write() syscall so
concurrent O_APPEND writers can't interleave partial lines.

Accept service name as a caller parameter in from_env_with_overrides
instead of hard-coding CARGO_PKG_NAME at compile time. Isolate
integration tests from production log paths via env var override.

Release-Note: Fix log files writing to wrong directory on macOS
Release-Impact: medium
@claylo claylo merged commit 0457423 into main Apr 5, 2026
5 checks passed
@claylo claylo deleted the chore/update-template branch April 5, 2026 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant