logs now output valid json, and accept different handles