nydus icon indicating copy to clipboard operation
nydus copied to clipboard

rotate nydusd log if it is configured to write to files

Open changweige opened this issue 3 years ago • 1 comments

By nydusd startup option --log-file , logs are written to a file. We'd better rotate it when it exceeds a certain size.

changweige avatar Aug 10 '22 06:08 changweige

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.

imeoer avatar Aug 12 '22 02:08 imeoer

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.

changweige avatar Aug 16 '22 05:08 changweige

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.

imeoer avatar Aug 16 '22 06:08 imeoer

Close it as it is implemented and merged

changweige avatar Aug 29 '22 07:08 changweige