method for getting last log entry