Remove printStackTrace calls that go to stdout and replace with logging