Stopped logging socket from being closed. Added exception for OSX and file paths