Replacing instances of PrintStream with PrintWriter and setting encoding in log4j.properties to UTF-8 to try and solve encoding issues