Fix both logs commands to correctly handle errors Upstream-commit: 946787e85e7c747c78354c5ca8d7a512b8766969 Component: engine