Allow for errors to be reported to a file instead of stderr
- Dominant language
- C
- Stars
- 29
- Forks
- 19
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 1
Description
# The Problem
Today, any errors in `chunkio` file operations will be reported to `stderr`. This is not a big deal when running an application using this library as a direct binary, since there are methods to redirect `stderr` when running directly. When running as a `systemd` service, you can set a `StandardError` configuration to report `stderr` to a file. The main situation where there is no recourse for this is when running as a Windows Service, which does not retain `stderr` and does not have a standard way to reconfigure it.
# Potential Solution
Allow configuring a log file for any chunkio logs.
# Alternatives Considered
Since the problem really shines as a Windows Service, this could be solved on Windows specifically by using the [SetStdHandle](https://learn.microsoft.com/en-us/windows/console/setstdhandle) function in the Win32 Console API. However, with all the work that would need to be done to allow configuration of this file just for Windows, you might as well do the implementation in a cross platform manner that may still benefit users on other platforms even if they have other escape hatches.
# Additional Context
This issue was discussed in person at the Fluent Bit Developer's Meeting on July 12,2023.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the chunkio file-operation paths that report errors to stderr and the existing initialization or configuration entry points. Define the configuration needed for a cross-platform log file, then verify that chunkio errors are written there instead of stderr while existing behavior remains available when no file is configured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100