only log when logger