Log: Last line now compatibile with Windows again

Switched back to using PHP code rather then shell code to get last line
to increase compatibility