[Request]: Add container log retrieval options
- Dominant language
- Swift
- Stars
- 49.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 22
Description
### Feature or enhancement request details
External orchestrators that drive `container` through the API server need to implement log UX that matches common container tooling, including retrieving only recent log lines and optionally requesting timestamped output.
Today `ContainerClient.logs(id:)` returns the raw container log and boot log file handles unconditionally. Consumers that need `--since` semantics have to replay the entire log stream and filter client-side, even though the API server is closest to the files and can apply the filter before returning handles.
Requested enhancement:
- Add a source-compatible `ContainerClient.logs(id:options:)` overload.
- Add a `ContainerLogOptions` API surface with:
- `since: Date?` to filter ISO-8601-prefixed log lines older than the requested timestamp.
- `timestamps: Bool` to reserve/forward timestamp preference through the API boundary.
- Preserve existing `logs(id:)` behavior as the default zero-option path.
This would unblock external compose-style orchestrators from implementing `logs --since ` and `logs --timestamps` against the `container` API without duplicating log filtering logic downstream.
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Start at the ContainerClient.logs(id:) entry point and trace the API boundary to the server-side container log handling. Confirm how the existing raw container and boot log handles are returned, then define the options behavior so the zero-option path remains unchanged and since/timestamps requests are supported.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- api
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100