add optional socket hook to logger