Fixed logging to append to file instead of overwriting