Write to log file