Added socket logging and log file rotation