Added configurable features

Added configurable logging and other features to help track down the
problem