Do not use basename in log

According to manual, basename() may modify the input string, and it need
not be reentrant, so we shall not use it to log filename.