Modifiying write_to_logfile to write_to_stderr

Cause that's what the function does.