Fix notice "undefine index of logfile".

Fix notice "undefine index of logfile".