replace system.out with log.debug