exchanged e.printstacktrace with logging statments