write log in tmp directory