@Override
	public void registerToken(NotificationToken token) {
		String logData = "";
		if (token.getType() == null) { // result
			logData += "Result of access request:\n";
			logData += "Time: "+token.getTimestamp()+"\n";
			logData += "Controller: "+token.getController()+"\n";
			logData += "AccessPoint: "+token.getAccessPoint()+"\n";
			logData += "Result: "+token.getResult()+"\n\n";
		}
		else {	// request
			logData += "Access request:\n";
			logData += "Time: "+token.getTimestamp()+"\n";
			logData += "Controller: "+token.getController()+"\n";
			logData += "AccessPoint: "+token.getAccessPoint()+"\n";
			logData += "Authorization type: "+token.getType().name()+"\n";
			if (token.getValue() != null) {
				logData += "Authorization data: "+token.getValue()+"\n\n";
			}
			else {
				logData += "ID: "+token.getId()+"\n";
				logData += "Passcode: "+token.getPasscode()+"\n\n";
			}
		}
		//System.out.println("Logging data: \n"+logData);
		try {
			output.write(logData);
			output.flush();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}