how can i limit the log file size? it was 7GB (on an old RPI 2 with 32GB SD Card)
for now i changed log level to fatal about same as no log but that is not optimal… also would be nice to write the log file to RAM
If you redirected logs to the file, the logrotate will work the same way, as for regular services.
If you didn’t - you may specify the internal log limits and rotation with options
thanks just for info maybe it helps someone:
i did now use the 2 --log commands u told me and i made a ramdisk in /store/ram (with mount -t tmpfs -o size=1024m myramdisk /store/ram/)
in config.yaml i set the log path to log.output: "/app/config/ram/node.log"
looks like its working fine and if the “–log-opt max-size=10m” works with 5 files max the ram disk should never get more than ~50MB… maybe 1GB was too much but no problem, switched from RPI to old PC with 16GB RAM
the docker’s options --log-opt working only if you do not redirect logs.
If you redirected logs - you need to use a logrotate or similar script to rotate them yourself. In case of RAM like you used it - it’s not possible at all.
If you want to reduce a verbosity you may set the log level to error instead of info.