Make LogEvent a trait with TaskLogEvent/CoreLogEvent subtypes

This means the taskId is never 0 - with no task we have to
use CoreLogEvent.

This paves the way for log events tagged with something other
than a task ID, such as a background job ID or whatever.