rustla2-api: glog writes unbounded log files to /tmp (no retention)
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 46
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
`rustla2-api` logs via glog's default file sink, which writes into `/tmp`
inside the container. glog opens a **new file per process start** and never
removes old ones, so a long-running deployment accumulates log files
indefinitely.
Observed on a long-lived container: ~50 files totalling ~6.7 GB, the oldest
dating to early 2024. Individual files reached 1.8 GB.
This is invisible in normal operation because a redeploy creates a fresh
container with an empty writable layer, discarding everything — then it
accumulates again from zero.
### Note on `--max_log_size`
Setting `--max_log_size` is **not** sufficient. That flag only rolls over to a
new file once the current one hits the cap; it does not delete previous files.
It would increase the file count without bounding total disk use.
### Suggested fix
Run with `--logtostderr` (or env `GLOG_logtostderr=1`) so logs go to stderr and
are captured by the container runtime, where they can be bounded by the log
driver's `max-size` / `max-file` options. This also makes `docker logs` useful
for this service, which it currently isn't.
If file logging is preferred instead, `--log_dir` should point at a mounted
volume with a logrotate policy attached.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the rustla2-api container launch configuration and its current glog setup. Verify how logs are written today, then make the service use stderr or a mounted volume with rotation; done means old files no longer accumulate unboundedly and container log collection is useful.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, docker
- Domain
- devops, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100