Changed logging to append, instead of truncate