Log exception instead of using printStackTrace, and warn instead debug.