Fixed bug in logging call when daemonizing