Fetch and truncate container logs

Continuation of #6662, closes #6630.

Requires rebase after #9216.

Docs commit coming.