public void logfile(String recipient, String msg) {
		if (server == null)
			return;
		try {
			Calendar now = Calendar.getInstance();
			int hour = now.get(Calendar.HOUR_OF_DAY);
			int minute = now.get(Calendar.MINUTE);
			int second = now.get(Calendar.SECOND);
			msg = (hour<10?"0":"") + hour + ":" + (minute<10?"0":"") + minute + "." + (second<10?"0":"") + second + " " + msg;

			for (int i = 0; i < server.channels.length; i++) {
				if (recipient != null && !recipient.equalsIgnoreCase(server.channels[i].name)) {
					continue;
				}
				if (logOut[i] != null) {
					logOut[i].write(msg, 0, msg.length());
					logOut[i].newLine();
					logOut[i].flush();
				}
			}
		} catch (IOException ioe) {
			logerror("Couldn't log to file!");
		}
	}