Adding debug output, and changing log filename
Converting poll interval to a define and setting to 5s.