List of usage examples for java.util.logging Level CONFIG
Level CONFIG
To view the source code for java.util.logging Level CONFIG.
Click Source Link
From source file:com.elasticbox.jenkins.k8s.repositories.api.kubeclient.KubernetesClientFactoryImpl.java
@Override public KubernetesClient createKubernetesClient(KubernetesCloudParams kubeCloudParams) { ConfigBuilder builder = new ConfigBuilder().withMasterUrl(kubeCloudParams.getEndpointUrl()); Authentication authData = kubeCloudParams.getAuthData(); if (authData != null) { if (authData instanceof TokenAuthentication) { builder.withOauthToken(((TokenAuthentication) authData).getAuthToken()); } else if (authData instanceof UserAndPasswordAuthentication) { builder.withUsername(((UserAndPasswordAuthentication) authData).getUser()); builder.withPassword(((UserAndPasswordAuthentication) authData).getPassword()); }// w ww. j a v a2 s. com } if (kubeCloudParams.isDisableCertCheck()) { builder.withTrustCerts(true); } else if (StringUtils.isNotEmpty(kubeCloudParams.getServerCert())) { builder.withCaCertData(kubeCloudParams.getServerCert()); } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.config("Creating Kubernetes client: " + kubeCloudParams.getEndpointUrl()); } return new DefaultKubernetesClient(builder.build()); }
From source file:com.github.marcosalis.kraken.utils.http.DefaultHttpRequestsManager.java
private DefaultHttpRequestsManager() { final Level logLevel = DroidConfig.DEBUG ? Level.CONFIG : Level.OFF; Logger.getLogger(HttpTransport.class.getName()).setLevel(logLevel); }
From source file:jp.ikedam.jenkins.plugins.extensible_choice_parameter.DatabaseChoiceListProvider.java
@Override public List<String> getChoiceList() { List<String> allChoices = performDbQuery(); LOGGER.log(Level.CONFIG, "Returned " + allChoices.size() + " entries from the database"); return allChoices; }
From source file:at.rocworks.oa4j.logger.logger.DataSink.java
private boolean createGroup(NoSQLSettings configs, String grpprefix) { NoSQLGroup group = null;/*from w ww. jav a 2 s . c om*/ boolean grun = configs.getBoolProperty(grpprefix, "run", false); int scount = configs.getIntProperty(grpprefix, "servers", 1); String name = configs.getStringProperty(grpprefix, "name", grpprefix); JDebug.out.log(Level.INFO, "loading group {0} run={1} servers={2} name={3}", new Object[] { grpprefix, grun, scount, name }); if (grun) { switch (configs.getDistribution()) { case ROBIN: group = new NoSQLGroupRobin(name, scount); break; case PINNED: group = new NoSQLGroupPinned(name, scount); break; default: JDebug.out.log(Level.SEVERE, "invalid distribution type {0}", configs.getDistribution()); } } if (!grun || group == null) { return false; } else { logger.addNoSQLGroup(group); } for (int i = 0; i < scount; i++) { try { String srvprefix = grpprefix + ".server." + i; String type = configs.getStringProperty(srvprefix, "type", ""); boolean srun = configs.getBoolProperty(srvprefix, "run", grun); if (!srun) continue; NoSQLSettings srvcfg; try { //srvcfg = configs.clone(); srvcfg = configs.cloneWithNewPath(srvprefix); } catch (CloneNotSupportedException ex) { JDebug.StackTrace(Level.SEVERE, ex); return false; } //srvcfg.readProperties(srvprefix); JDebug.out.log(Level.CONFIG, "section {0}...", type); switch (type) { // case "com.etm.dbs.nosql.NoSQLCassandra": // { // NoSQLServer srv = com.etm.dbs.nosql.NoSQLCassandra.createServer(srvcfg, srvprefix); // group.setNoSQLServer(i, srv); // break; // } // case "com.etm.dbs.nosql.NoSQLMongoDB": // { // NoSQLServer srv = com.etm.dbs.nosql.NoSQLMongoDB.createServer(srvcfg, srvprefix); // group.setNoSQLServer(i, srv); // break; // } // case "com.etm.dbs.nosql.NoSQLElasticSearch": // { // NoSQLServer srv = com.etm.dbs.nosql.NoSQLElasticSearch.createServer(srvcfg, srvprefix); // group.setNoSQLServer(i, srv); // break; // } default: { Class<?> clazz = Class.forName(type); Method create = clazz.getMethod("createServer", NoSQLSettings.class, String.class); NoSQLServer srv = (NoSQLServer) create.invoke(null, srvcfg, srvprefix); group.setNoSQLServer(i, srv); break; } } } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException ex) { JDebug.StackTrace(Level.SEVERE, ex); } catch (InvocationTargetException ex) { try { throw ex.getTargetException(); } catch (Throwable throwable) { JDebug.StackTrace(Level.SEVERE, ex); } } } return true; }
From source file:cz.cuni.mff.d3s.tools.perfdoc.server.measuring.MethodMeasurer.java
/** * Performs measurement on given MeasureRequest. * * @return JSONObject that contains measured results. *///w w w . j a v a 2 s .c o m public JSONObject measure() { //requested measurement quality MeasurementQuality mQuality = measureRequest.getMeasurementQuality(); int priority = mQuality.getPriority(); WorkloadImpl workloadImpl = new WorkloadImpl(); ServiceWorkloadImpl serviceImpl = new ServiceWorkloadImpl(); //passing the priority to generator serviceImpl.setPriority(priority); //values chosen from rangeValue to measure data in double step = MeasuringUtils.findStepValue(measureRequest.getWorkload(), measureRequest.getRangeVal()); Object rangeArgument = measureRequest.getValues()[measureRequest.getRangeVal()]; //note that this might end with IllegalArgument | NumberFormat Exception, that is being handled by the caller double[] valuesToMeasure = MeasuringUtils.getValuesToMeasure(rangeArgument, step, mQuality.getNumberOfPoints()); //for every point, that should be measured, we perform a measurement for (int i = 0; i < valuesToMeasure.length; i++) { //the arguments for the generator Object[] args = MeasuringUtils.prepareArgsToCall(measureRequest, workloadImpl, serviceImpl, valuesToMeasure[i]); BenchmarkSetting benSetting = new BenchmarkSettingImpl(measureRequest, new MethodArgumentsImpl(args)); //if cache contains results for given settings, we do not have to perform measurement BenchmarkResult res = resultCache.getResult(benSetting); if (res != null) { results.add(res); resultsMask.add(true); log.log(Level.CONFIG, "The value for measuring was found in cache."); continue; } BenchmarkRunner runner = null; switch (priority) { case 1: case 2: case 3: runner = new MethodReflectionRunner(); break; case 4: runner = new DirectRunner(); break; } //wait until we can measure (there is no lock for our hash) lockBase.waitUntilFree(measureRequest.getUserID()); results.add(new BenchmarkResultImpl(runner.measure(benSetting), benSetting)); lockBase.freeLock(measureRequest.getUserID()); resultsMask.add(false); } log.log(Level.CONFIG, "Measurement succesfully done"); return processBenchmarkResults(valuesToMeasure); }
From source file:jenkins.util.SystemProperties.java
/** * Gets the system property indicated by the specified key. * This behaves just like {@link System#getProperty(java.lang.String)}, except that it * also consults the {@link ServletContext}'s "init" parameters. * /*from w w w . j ava 2 s.co m*/ * @param key the name of the system property. * @return the string value of the system property, * or {@code null} if there is no property with that key. * * @exception NullPointerException if {@code key} is {@code null}. * @exception IllegalArgumentException if {@code key} is empty. */ @CheckForNull public static String getString(String key) { String value = System.getProperty(key); // keep passing on any exceptions if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (system): {0} => {1}", new Object[] { key, value }); } return value; } value = tryGetValueFromContext(key); if (value != null) { if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (context): {0} => {1}", new Object[] { key, value }); } return value; } if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.log(Level.CONFIG, "Property (not found): {0} => {1}", new Object[] { key, value }); } return null; }
From source file:com.google.enterprise.connector.sharepoint.dao.UserDataStoreDAO.java
/** * Retrieves all the membership information pertaining to a user. This would * be useful to serve the GSA -> CM requests during session channel creation * * @param username the user's login name, NOT the ID * @return list of {@link UserGroupMembership} representing memberships of the * user/* w ww .j ava 2 s .com*/ */ public List<UserGroupMembership> getAllMembershipsForUser(final String username) throws SharepointException { UserGroupMembership paramMembership = new UserGroupMembership(); paramMembership.setUserName(username); List<UserGroupMembership> lstParamMembership = new ArrayList<UserGroupMembership>(); lstParamMembership.add(paramMembership); Query query = Query.UDS_SELECT_FOR_USERNAME; SqlParameterSource[] params = createParameter(query, lstParamMembership); List<UserGroupMembership> memberships = null; try { memberships = getSimpleJdbcTemplate().query(getSqlQuery(query), rowMapper, params[0]); } catch (Throwable t) { throw new SharepointException( "Query execution failed while getting the membership info of a given user ", t); } LOGGER.log(Level.CONFIG, memberships.size() + " Memberships identified for user [ " + username + " ]. "); return memberships; }
From source file:org.pascani.dsl.dbmapper.databases.ElasticSearch.java
private Map<String, String> handle(NewMonitorEvent e) { Map<String, String> data = new HashMap<String, String>(); data.put("level", Level.CONFIG.getName()); data.put("logger", e.value() + ""); data.put("message", "Monitor " + e.value() + " has been deployed"); data.put("source", e.value() + ""); data.put("timestamp", e.timestamp() + ""); return data;/*from w ww.j a v a 2 s. co m*/ }
From source file:com.google.enterprise.connector.sharepoint.wsclient.soap.SPSiteDataWS.java
/** * @param inSharepointClientContext The Context is passed so that necessary * information can be used to create the instance of current class * Web Service endpoint is set to the default SharePoint URL stored * in SharePointClientContext./*from ww w .ja va 2 s . co m*/ * @throws SharepointException */ public SPSiteDataWS(final SharepointClientContext inSharepointClientContext) throws SharepointException { if (inSharepointClientContext != null) { sharepointClientContext = inSharepointClientContext; endpoint = Util.encodeURL(sharepointClientContext.getSiteURL()) + SPConstants.SITEDATAENDPOINT; LOGGER.log(Level.CONFIG, "Endpoint set to: " + endpoint); final SiteDataLocator loc = new SiteDataLocator(); loc.setSiteDataSoapEndpointAddress(endpoint); final SiteData servInterface = loc; try { stub = (SiteDataSoap_BindingStub) servInterface.getSiteDataSoap(); } catch (final ServiceException e) { LOGGER.log(Level.WARNING, e.getMessage(), e); throw new SharepointException("unable to create sitedata stub"); } final String strDomain = inSharepointClientContext.getDomain(); String strUser = inSharepointClientContext.getUsername(); final String strPassword = inSharepointClientContext.getPassword(); strUser = Util.getUserNameWithDomain(strUser, strDomain); stub.setUsername(strUser); stub.setPassword(strPassword); // The web service time-out value stub.setTimeout(sharepointClientContext.getWebServiceTimeOut()); LOGGER.fine("Set time-out of : " + sharepointClientContext.getWebServiceTimeOut() + " milliseconds"); } }
From source file:org.pascani.dsl.dbmapper.databases.ElasticSearch.java
private Map<String, String> handle(NewNamespaceEvent e) { Map<String, String> data = new HashMap<String, String>(); data.put("level", Level.CONFIG.getName()); data.put("logger", e.value() + ""); data.put("message", "Namespace " + e.value() + " has been deployed"); data.put("source", e.value() + ""); data.put("timestamp", e.timestamp() + ""); return data;//from www . j ava2 s.c om }