replace printStackTrace calls with logger messages.