create context collector for logging, various improvements