Added debug message and logfile capabilities in the daemon