Declare $log array first

Otherwise it crashes when no log is found.