agave-common/common-core/src/main/java/org/iplantc/service/common/clients/AgaveLogServiceClient.java
/**
	 * Call to agave's internal log service to track requests. This is deprecated in favor of an infrastructure level
	 * solution
	 * @param serviceKey the api being called
	 * @param activityKey the key representing the request type being made
	 * @param username the user making the call
	 * @param activityContext the context of the activity
	 * @param ipAddress the caller ip address
	 */
Call to agave's internal log service to track requests.
Call to agave ' s internal log service to track requests .
public static void log(String serviceKey, String activityKey, String username, String activityContext, String ipAddress) 
	{
			 Construct data
		    String urlParameters = "servicekey=" + URLEncoder.encode(serviceKey, "UTF-8");
		    urlParameters += "&activitykey=" + URLEncoder.encode(activityKey, "UTF-8");
		    urlParameters += "&username=" + URLEncoder.encode(username, "UTF-8");
		    urlParameters += "&activitycontext=" + URLEncoder.encode(activityContext, "UTF-8");
		    urlParameters += "&userip=" + URLEncoder.encode(ipAddress, "UTF-8");
		    urlParameters += "&clientId=" + URLEncoder.encode(TenancyHelper.getCurrentApplicationId(), "UTF-8");
		    urlParameters += "&tenantId=" + URLEncoder.encode(TenancyHelper.getCurrentTenantId(), "UTF-8");
		     Send data
		    URL url = new URL(Settings.IPLANT_LOG_SERVICE + serviceKey);
		    connection = (HttpURLConnection)url.openConnection();
		    connection.setRequestMethod("POST");
		    connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
		    connection.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length));
		    connection.setRequestProperty("Content-Language", "en-US");
			connection.setUseCaches (false);
			connection.setDoOutput(true);
			connection.setDoInput(true);
			try (DataOutputStream wr = new DataOutputStream(connection.getOutputStream())) {
				wr.writeBytes(urlParameters);
				wr.flush();
			}
		    Get Response
		    try (InputStream is = connection.getInputStream()) {
				BufferedReader rd = new BufferedReader(new InputStreamReader(is));
				String line;
				StringBuffer response = new StringBuffer();
				while ((line = rd.readLine()) != null) {
					response.append(line);
					response.append('\r');
				}
				rd.close();
			}
		}
		catch (Exception e) {
			logger.debug("Failed to call remote logging service: " + e.getMessage());
		}
		finally {
			try { if (wr != null) wr.close(); } catch (Throwable ignored) {}
			try { if (connection != null) connection.disconnect(); } catch (Throwable ignored) {}
		}
	}
public static void log ( String serviceKey , String activityKey , String username , String activityContext , String ipAddress ) { }
Call to agave's internal log service to track requests.
Call to agave ' s internal log service to track requests .
//		DataOutputStream wr = null; //		HttpURLConnection connection = null; //		try //		{ //			logger.info("Calling  " + serviceKey + ", " + username + ", " + activityKey + ", " + activityContext + ", " + ipAddress + ", " + TenancyHelper.getCurrentTenantId()); // //			// Construct data //		    String urlParameters = "servicekey=" + URLEncoder.encode(serviceKey, "UTF-8"); //		    urlParameters += "&activitykey=" + URLEncoder.encode(activityKey, "UTF-8"); //		    urlParameters += "&username=" + URLEncoder.encode(username, "UTF-8"); //		    urlParameters += "&activitycontext=" + URLEncoder.encode(activityContext, "UTF-8"); //		    urlParameters += "&userip=" + URLEncoder.encode(ipAddress, "UTF-8"); //		    urlParameters += "&clientId=" + URLEncoder.encode(TenancyHelper.getCurrentApplicationId(), "UTF-8"); //		    urlParameters += "&tenantId=" + URLEncoder.encode(TenancyHelper.getCurrentTenantId(), "UTF-8"); // //		    // Send data // //		    URL url = new URL(Settings.IPLANT_LOG_SERVICE + serviceKey); // //		    connection = (HttpURLConnection)url.openConnection(); //		    connection.setRequestMethod("POST"); //		    connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); //		    connection.setRequestProperty("Content-Length", "" + Integer.toString(urlParameters.getBytes().length)); //		    connection.setRequestProperty("Content-Language", "en-US"); //			connection.setUseCaches (false); //			connection.setDoOutput(true); //			connection.setDoInput(true); // //			try (DataOutputStream wr = new DataOutputStream(connection.getOutputStream())) { //				wr.writeBytes(urlParameters); //				wr.flush(); //			} // //		    //Get Response ////		    try (InputStream is = connection.getInputStream()) { ////				BufferedReader rd = new BufferedReader(new InputStreamReader(is)); ////				String line; ////				StringBuffer response = new StringBuffer(); ////				while ((line = rd.readLine()) != null) { ////					response.append(line); ////					response.append('\r'); ////				} ////				rd.close(); //// ////			} //		} //		catch (Exception e) { //			logger.debug("Failed to call remote logging service: " + e.getMessage()); //		} //		finally { ////			try { if (wr != null) wr.close(); } catch (Throwable ignored) {} //			try { if (connection != null) connection.disconnect(); } catch (Throwable ignored) {} //		}