being less explicit with attribute check due to differences with Windows XP
adding environment variable for root logger level
adding some internal logging for the secondary search
fixing an internal logic typo