Unraid docker log file size

check all the docker app log file size with one command:

co=$(docker inspect –format='{{.Name}}’ $(docker ps -aq –no-trunc) | sed ‘s/^.(.)/\1/’ | sort); for c_name in $co; do c_size=$(docker inspect –format={{.ID}} $c_name | xargs -I @ sh -c ‘ls -hl /var/lib/docker/containers/@/@-json.log’ | awk ‘{print $5 }’); YE=’\033[1;33m’; NC=’\033[0m’; PI=’\033[1;35m’; RE=’\033[1;31m’; case “$c_size" in *"K"*) c_size=${YE}$c_size${NC};; “M”) p=${c_size%.*}; q=${p%M}; r=${#q}; if [[ $r -lt 3 ]]; then c_size=${PI}$c_size${NC}; else c_size=${RE}$c_size${NC}; fi ;; esac; echo -e “$c_name $c_size”; done

—From unraid community forum post

Thanks

or

Additionally, you can limit any docker’s logging to a set size by adding the following to the Extra Parameters when you edit the application template (Switch to advanced view via the button in the top right corner)

log-opt max-size=50m –log-opt max-file=1

—From unraid community forum post