Added a guard around logging a redirected operation