Add working logging system. Should probably add QUIT support to it.