Closed gsora closed 11 months ago
A simple solution would be to add optional logging driver config to cdvn repo. Either manually to each compose service or globally as docker default logging driver. A good option is journald which has log rotation built in.
🎯 Problem to be solved
Charon has been designed from the beginning with a no-disk-write approach: aside for the DKG and
create cluster
, Charon never writes anything on disk.The container-exclusive deployment strategy leaves the burden of log retention to the user: since on container restart logs are lost, the user needs to devise a plan to persist them somewhere in order to audit and eventually find and report bugs to us.
🛠️ Proposed solution
I propose we consider the implementation of a on-disk log retention strategy, where Charon writes logs on the already existing facilities (Loki, stdout) as well as files - plural here because log files need to be periodically rotated.
Zap provides multiple ways of configuring custom logging outputs, and they document a way of automating log rotation and compression from within the codebase itself: https://github.com/uber-go/zap/blob/master/FAQ.md#usage.