code: public static void logShellEnvironmentVariables() {
  		Map<String, String> env = System.getenv();
  		Iterator<String> keys = env.keySet().iterator();
  		while (keys.hasNext() ) {
  			String key = keys.next();
  			String value = env.get(key);
  			logMessage("Env, "+key+"="+value.trim());
  		}
  	}
docs: Log shell environment variables associated with Java process.