logging only when the command is executed.