change all process to function.
add code for write to syslog.