Fetch and truncate container logs

Continuation of #6662, closes #6630.

Requires rebase after #9216.

Docs commit coming.
Noticed the "HISTORY" section below while reading; does this change require a new entry there?