add optional socket hook to logger

@anthonybishopric  @petertseng