move logging init into main stack, fix improper invocation of isfile check