Fetch and truncate container logs

Continuation of #6662, closes #6630.

Requires rebase after #9216.

Docs commit coming.
Is this safe? Should the container be paused while truncating to ensure no logs are lost?