Server: Improve debug, warning and error log messages
The log messages should be understandable even without wider context
and should contain references to entities or tasks that have failed.
(cherry picked from commit 16a563bcdcb76962b2343e9fb5cae53c4f60144e)