In daemon mode, write output into log file