Replace System.out with logging