TryGhost / TryGhost/docker-library-ghost
Log rotation
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 796
- Forks
- 319
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 6
Description
Hi,
It would be great to have logrotate preconfigured, since /var/lib/ghost/content/logs folder is ever-growing. That cause issues when deploying to k8s, since pod would eventually crash:
[ghost-56f4c644f9-gps8f ghost] [2021-11-24 15:46:52] [36mINFO[39m Ghost server started in 0.512s
[ghost-56f4c644f9-gps8f ghost] events.js:377
[ghost-56f4c644f9-gps8f ghost] throw er; // Unhandled 'error' event
[ghost-56f4c644f9-gps8f ghost] ^
[ghost-56f4c644f9-gps8f ghost]
[ghost-56f4c644f9-gps8f ghost] Error: ENOSPC: no space left on device, write
[ghost-56f4c644f9-gps8f ghost] Emitted 'error' event on Logger instance at:
[ghost-56f4c644f9-gps8f ghost] at WriteStream.onStreamError (/var/lib/ghost/versions/4.20.3/node_modules/bunyan/lib/bunyan.js:627:18)
[ghost-56f4c644f9-gps8f ghost] at WriteStream.emit (events.js:400:28)
[ghost-56f4c644f9-gps8f ghost] at emitErrorNT (internal/streams/destroy.js:106:8)
[ghost-56f4c644f9-gps8f ghost] at emitErrorCloseNT (internal/streams/destroy.js:74:3)
[ghost-56f4c644f9-gps8f ghost] at processTicksAndRejections (internal/process/task_queues.js:82:21) {
[ghost-56f4c644f9-gps8f ghost] errno: -28,
[ghost-56f4c644f9-gps8f ghost] code: 'ENOSPC',
[ghost-56f4c644f9-gps8f ghost] syscall: 'write'
[ghost-56f4c644f9-gps8f ghost] }
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 at the repository's image packaging entry point and trace how /var/lib/ghost/content/logs is created and written. Check the Kubernetes deployment context and the reported ENOSPC failure to determine where rotation belongs. Done means the image has a documented, testable way to prevent unbounded log growth without filling the pod's storage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, kubernetes, shell
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100