Add a mechanism to reopen Fluent Bit's own log file
- Dominant language
- C
- Stars
- 8.1k
- Forks
- 2k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 71
Description
Fluent Bit can be configured to use a dedicated log file (via the `Log_File` option).
For tools like `logrotate` to work, Fluent Bit must be told to reopen its log file.
Instead of stopping and then restarting Fluent Bit, it would be much better to tell Fluent Bit to just reopen its log file.
Many daemons use the `SIGHUP` signal for this purpose but, [looking at the code](https://github.com/fluent/fluent-bit/blob/master/src/fluent-bit.c#L401), it seems that Fluent Bit treat the signals `SIGINT`, `SIGQUIT`, `SIGHUP` and `SIGTERM` the exact same way.
Please add a mechanism to tell Fluent Bit to reopen its log file, maybe by simply changing the `SIGHUP` handler.
Contributor guide
Research direction
Start with the signal handling in src/fluent-bit.c around line 401 and review how Log_File is configured and managed. Check how logrotate would signal Fluent Bit and identify the existing logging lifecycle. Done means Fluent Bit can reopen its configured log file on SIGHUP without stopping or restarting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- observability-sre
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100