Move JSON logging to a central place.