Added logging function, preparing server for receiving from client