alternative log rotation strategy that avoids truncating logs
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
Currently logs are truncated when they are rotated. This is how it is usually done in the Linux world, but it makes it hard to use log aggregation systems such as LogStash or FileBeat.
To facilitate the use of such tools, it would be nice if it was possible to change the log rotation strategy, such that the names of log files are always unique, and logs are append-only, with no truncation. For example, the name of the files can be based on the date, and at midnight, NextCloud just starts logging to a new file with the next day's date.
Currently I have set up a cron job that changes the name of log files in config.php once a day at midnight, but this is pretty ugly.
For context, I'm running NextCloud in Docker, and I need to use FileBeat to collect the log files into a database.
Contributor guide
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
No files, tests, or entry points are named. Start by locating Nextcloud's current log rotation and config.php handling, then trace how rotation is triggered; done means an explicit alternative can produce uniquely dated, append-only files for FileBeat or LogStash without the cron workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend, devops
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100