Pass in the log directory.
Daemonize, set the pidfile in the command line, log to a log file in case of startup failure.
Log in case of failure.