try {
File logfile = new File("C:\\temp\\serverLogfile");
OutputStream outputStream = new FileOutputStream(logfile);
Printer printer = new NullPrinter(outputStream);
Naming.rebind(DEFAULT_PRINTER_NAME, printer);
} catch (Exception e) {
e.printStackTrace();
}