List of usage examples for java.util.logging Level INFO
Level INFO
To view the source code for java.util.logging Level INFO.
Click Source Link
From source file:com.marvelution.hudson.plugins.jirareporter.utils.IssueTextUtils.java
/** * Create the text content for a specific issue field * /*ww w. j a v a 2s .co m*/ * @param type the {@link Type} of text to create * @param build the {@link AbstractBuild} * @param site the {@link JIRASite} * @return the created text content */ public static String createFieldText(Type type, AbstractBuild<?, ?> build, JIRASite site) { final StringWriter writer = new StringWriter(); final XMLOutput output = XMLOutput.createXMLOutput(writer); final JellyContext context = new JellyContext(); context.setVariable("rootURL", Hudson.getInstance().getRootUrl()); context.setVariable("build", build); context.setVariable("site", site); try { Class.forName("jenkins.model.Jenkins"); context.setVariable("system", "Jenkins"); } catch (ClassNotFoundException e) { context.setVariable("system", "Hudson"); } context.setVariable("version", Hudson.getVersion().toString()); try { context.setVariable("environment", build.getEnvironment(new LogTaskListener(LOGGER, Level.INFO))); } catch (Exception e) { context.setVariable("environment", Collections.emptyMap()); } // Utilize the Dozer Mapper and its convertors of the API V2 plugin to get the ChangeLog and TestResults try { context.setVariable("changelog", DozerUtils.getMapper().map(build.getChangeSet(), ChangeLog.class)); } catch (Exception e) { context.setVariable("changelog", new ChangeLog()); } try { context.setVariable("testresults", DozerUtils.getMapper().map(build, TestResult.class)); } catch (Exception e) { context.setVariable("testresults", new TestResult()); } try { context.runScript( HudsonPluginUtils.getPluginClassloader().getResource("fields/" + type.field(site) + ".jelly"), output); } catch (JellyException e) { LOGGER.log(Level.SEVERE, "Failed to create Text of type " + type.name(), e); throw new IllegalStateException("Cannot raise an issue if no text is available", e); } return writer.toString().trim(); }
From source file:net.chrissearle.flickrvote.web.admin.LoginAsPhotographer.java
@Override public String execute() throws Exception { Photographer admin = (Photographer) session.get(FlickrVoteWebConstants.FLICKR_USER_SESSION_KEY); Photographer photographer = new DisplayPhotographer(service.findById(id)); session.put(FlickrVoteWebConstants.FLICKR_USER_SESSION_KEY, photographer); if (logger.isLoggable(Level.INFO)) { logger.info("Admin " + admin.getPhotographerName() + " just logged in as " + photographer.getPhotographerName()); }//w w w . j a v a2 s . c o m return SUCCESS; }
From source file:com.aalto.controllers.ProjectController.java
@RequestMapping(value = "/getProjectByPid/{pidString}", method = RequestMethod.GET) public Project getProjectByPid(@PathVariable String pidString) { logger.log(Level.INFO, "log: ProjectController getProjectByPid !!"); Long pid = Long.valueOf(pidString); Project project = this.projectRepo.find(pid); return project; }
From source file:org.activiti.crystalball.simulator.impl.simulationexecutor.SimulationRunExecuteJobHandler.java
public void execute(JobEntity job, String configuration, SimulationInstanceEntity simulationInstance, CommandContext commandContext) { log.log(Level.INFO, "Starting simulation experiment [" + simulationInstance + "] configuration [" + configuration + "]"); SimulationRunEntity simulationRun = commandContext.getSimulationRunManager() .findSimulationRunWithReferencesById(configuration); SimulationContext.setSimulationRun(simulationRun); //initializeSimulationRun ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext( simulationRun.getSimulation().getSimulationConfigUrl()); PropertyPlaceholderConfigurer propConfig = new PropertyPlaceholderConfigurer(); Properties properties = new Properties(); properties.put("simulationRunId", configuration); propConfig.setProperties(properties); appContext.addBeanFactoryPostProcessor(propConfig); appContext.refresh();/*from w w w. j a v a2 s.c o m*/ SimulationRunHelper runHelper = new NoopSimulationRunHelper(); if (appContext.containsBean("simulationRunHelper")) runHelper = (SimulationRunHelper) appContext.getBean("simulationRunHelper"); try { runHelper.before(configuration); SimulationRun simRun = (SimulationRun) appContext.getBean("simulationRun"); simRun.execute(simulationRun); } catch (Exception e) { log.log(Level.SEVERE, "SimulationRun handling error" + simulationRun, e); } finally { runHelper.after(configuration); appContext.close(); } job.delete(); SimulationContext.removeSimulationRun(); // check whether all jobs for given simulationInstance were already executed. simulationInstance.checkActivity(); log.log(Level.INFO, "finished simulation experiment [" + simulationInstance + "] configuration [" + configuration + "]"); }
From source file:com.jsmartframework.web.manager.AuthEncrypter.java
static String encrypt(HttpServletRequest request, String key, Object value) { if (key != null && value != null) { try {//from ww w . java2 s. c om byte[] encode = getEncryptCipher(request, key).doFinal(value.toString().getBytes("UTF8")); return new String(Base64.encodeBase64(encode, true, true)).trim(); } catch (Exception ex) { LOGGER.log(Level.INFO, "Failed to encrypt value [" + value + "]: " + ex.getMessage()); } return value.toString(); } return null; }
From source file:bridgempp.GroupManager.java
public static void saveAllGroups() { ShadowManager.log(Level.INFO, "Saving all groups..."); try {// ww w . ja v a2s . c om ConfigurationManager.groupConfiguration.clear(); for (int g = 0; g < groups.size(); g++) { Group group = groups.get(g); ConfigurationManager.groupConfiguration.addProperty("groups.group(-1).name", group.getName()); for (int e = 0; e < group.getEndpoints().size(); e++) { Endpoint.writeEndpoint(group.getEndpoints().get(e), ConfigurationManager.groupConfiguration, "groups.group."); } } ConfigurationManager.groupConfiguration.save(); } catch (ConfigurationException ex) { Logger.getLogger(GroupManager.class.getName()).log(Level.SEVERE, null, ex); } ShadowManager.log(Level.INFO, "Saved all groups"); }
From source file:com.qualogy.qafe.web.ContextLoader.java
public static String getContextPath(ServletContext servletContext) throws MalformedURLException, URISyntaxException { // The default way: works on JBoss/Tomcat/Jetty String contextPath = servletContext.getRealPath("/WEB-INF/"); // This is how a weblogic explicitly wants the fetching of resources. if (contextPath == null) { URL url = servletContext.getResource("/WEB-INF/"); logger.log(Level.INFO, "Fallback scenario " + url.toString()); if (url != null) { logger.log(Level.INFO, "URL to config file " + url.toString()); contextPath = url.toURI().toString(); } else {/* w w w . ja va2s . c o m*/ throw new RuntimeException( "Strange Error: /WEB-INF/ cannot be found. Check the appserver or installation directory."); } } return contextPath; }
From source file:io.fabric8.jenkins.openshiftsync.BuildTrigger.java
@Override public void stop() { String name = super.job != null ? super.job.getFullName() : "NOT STARTED"; logger.log(Level.INFO, "Stopping the OpenShift Build trigger for project {0}", name); if (super.job != null) { this.buildConfigProjectProperty = super.job.getProperty(BuildConfigProjectProperty.class); if (this.buildConfigProjectProperty != null) { String buildConfigUid = this.buildConfigProjectProperty.getUid(); if (!StringUtils.isEmpty(buildConfigUid)) { DESCRIPTOR.removeBuildConfigTrigger(buildConfigUid, super.job); }// w w w .j a va 2 s.c om } } super.stop(); }
From source file:me.heyimblake.HiveMCRank.Utils.WebConnector.java
/** * Returns the Hive Name of the rank of a supplied UUID. Regular Member is returned if null. * * @param uuid the UUID of the player//from w w w .j a va2 s . c om * @return Hive Name of the rank of the UUID * @throws Exception thrown if the UUID has never been on TheHive or TheHive's API is not available. Default Rank is returned. */ public String getHiveRank(final UUID uuid) throws Exception { String rankfromapi; final String uuidNoDash = uuid.toString().replace("-", ""); try { final String API_URL = "http://api.hivemc.com/v1/player/"; final URLConnection connection = new URL(API_URL + uuidNoDash).openConnection(); Bukkit.getServer().getLogger().log(Level.INFO, "Connection opened to " + API_URL + uuidNoDash); connection.addRequestProperty("User-Agent", "Mozilla/5.0"); final JSONTokener tokener = new JSONTokener(connection.getInputStream()); final JSONObject root = new JSONObject(tokener); if (root.getString("rankName") == null) { rankfromapi = "Regular Member"; } else { rankfromapi = root.getString("rankName"); } } catch (Exception e) { Bukkit.getServer().getLogger().log(Level.SEVERE, "Exception occurred while trying to get the HiveMC rank of " + uuid); Bukkit.getServer().getLogger().log(Level.SEVERE, "Chances are that the user has never logged onto TheHive before. Their rank has been set to regular for now."); rankfromapi = "Regular Member"; } return rankfromapi; }
From source file:hr.foi.sis.controllers.TestDataController.java
@RequestMapping(value = "/add", method = RequestMethod.POST) @PreAuthorize("isAuthenticated()") public ResponseEntity addData(@RequestBody TestData data) { Logger.getLogger("TestDataController.java").log(Level.INFO, "POST on /testdata/ "); Person creator = (Person) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); Logger.getLogger("TestDataController.java").log(Level.INFO, "POST on /testdata/ for user" + creator.getName()); data.setPerson(creator);//from w w w . j a va 2 s .c o m TestData saved = this.testDataRepository.save(data); if (saved != null) return new ResponseEntity(HttpStatus.OK); else return new ResponseEntity(HttpStatus.BAD_REQUEST); }