Debugging : Writing error logs