Writing own logfile before panicking