nydus
nydus copied to clipboard
rotate nydusd log if it is configured to write to files
By nydusd startup option --log-file , logs are written to a file. We'd better rotate it when it exceeds a certain size.
Typically nydusd is called by the control component (snapshotter/crio storage plugin), my suggestion is that nydusd should only support directing logs to stdout/stderr to allow the control component more flexibility in aggregating log timeline, filtering by subsystem, and rotating logs.
I suppose it's a user's decision how to transport and persist nydusd logs. Stdout/stderr and regurlar log files are not conflicted with each other. Moreover, nydusd already provides a CLI option to configure it, we can't just remove the option --log-file. In practice, AFAIK, many user choose to store logs into regular files.
In scenarios where nydusd is used separately, it can use its own log file, but when integrated into snapshotter, we should let use the snapshotter logger directly.
Close it as it is implemented and merged