write to log file