log read bugfix: set the return value
log bugfix: printing issues
Do not forget to copy the path. Protect the sprintf