private static void log ( File logFile , long connectionId , char separator , String line ) { synchronized ( logFile ) { try { try ( Writer out = new FileWriter ( logFile , true ) ) { out . write ( Long . toString ( connectionId ) ) ; out . write ( separator ) ; out . write ( ' ' ) ; out . write ( line ) ; out . write ( ' ' ) ; } } catch ( IOException e ) { e . printStackTrace ( System . err ) ; } } }
Writes one line to the given file synchronizes on the file object .