Improve logging so that each task get logged at start and end.