List of usage examples for java.util.logging Level FINER
Level FINER
To view the source code for java.util.logging Level FINER.
Click Source Link
From source file:org.b3log.solo.event.rhythm.ArticleSender.java
@Override public void action(final Event<JSONObject> event) throws EventException { final JSONObject data = event.getData(); LOGGER.log(Level.FINER, "Processing an event[type={0}, data={1}] in listener[className={2}]", new Object[] { event.getType(), data, ArticleSender.class.getName() }); try {//from w w w. j av a 2 s.c o m final JSONObject originalArticle = data.getJSONObject(Article.ARTICLE); if (!originalArticle.getBoolean(Article.ARTICLE_IS_PUBLISHED)) { LOGGER.log(Level.FINER, "Ignores post article[title={0}] to Rhythm", originalArticle.getString(Article.ARTICLE_TITLE)); return; } final JSONObject preference = preferenceQueryService.getPreference(); if (null == preference) { throw new EventException("Not found preference"); } final String blogHost = preference.getString(Preference.BLOG_HOST).toLowerCase(); if (blogHost.contains("localhost")) { LOGGER.log(Level.INFO, "Blog Solo runs on local server, so should not send this article[id={0}, title={1}] to Rhythm", new Object[] { originalArticle.getString(Keys.OBJECT_ID), originalArticle.getString(Article.ARTICLE_TITLE) }); return; } final HTTPRequest httpRequest = new HTTPRequest(); httpRequest.setURL(ADD_ARTICLE_URL); httpRequest.setRequestMethod(HTTPRequestMethod.POST); final JSONObject requestJSONObject = new JSONObject(); final JSONObject article = new JSONObject(); article.put(Keys.OBJECT_ID, originalArticle.getString(Keys.OBJECT_ID)); article.put(Article.ARTICLE_TITLE, originalArticle.getString(Article.ARTICLE_TITLE)); article.put(Article.ARTICLE_PERMALINK, originalArticle.getString(Article.ARTICLE_PERMALINK)); article.put(Article.ARTICLE_TAGS_REF, originalArticle.getString(Article.ARTICLE_TAGS_REF)); article.put(Article.ARTICLE_AUTHOR_EMAIL, originalArticle.getString(Article.ARTICLE_AUTHOR_EMAIL)); article.put(Article.ARTICLE_CONTENT, originalArticle.getString(Article.ARTICLE_CONTENT)); article.put(Article.ARTICLE_CREATE_DATE, ((Date) originalArticle.get(Article.ARTICLE_CREATE_DATE)).getTime()); article.put(Common.POST_TO_COMMUNITY, originalArticle.getBoolean(Common.POST_TO_COMMUNITY)); // Removes this property avoid to persist originalArticle.remove(Common.POST_TO_COMMUNITY); requestJSONObject.put(Article.ARTICLE, article); requestJSONObject.put(Common.BLOG_VERSION, SoloServletListener.VERSION); requestJSONObject.put(Common.BLOG, "B3log Solo"); requestJSONObject.put(Preference.BLOG_TITLE, preference.getString(Preference.BLOG_TITLE)); requestJSONObject.put(Preference.BLOG_HOST, blogHost); requestJSONObject.put("userB3Key", preference.optString(Preference.KEY_OF_SOLO)); requestJSONObject.put("clientAdminEmail", preference.optString(Preference.ADMIN_EMAIL)); requestJSONObject.put("clientRuntimeEnv", Latkes.getRuntimeEnv().name()); httpRequest.setPayload(requestJSONObject.toString().getBytes("UTF-8")); urlFetchService.fetchAsync(httpRequest); } catch (final Exception e) { LOGGER.log(Level.SEVERE, "Sends an article to Rhythm error: {0}", e.getMessage()); } LOGGER.log(Level.FINER, "Sent an article to Rhythm"); }
From source file:com.esri.gpt.control.webharvest.client.waf.WafProxy.java
public String read(String sourceUri) throws IOException { LOGGER.log(Level.FINER, "Reading metadata of source URI: \"{0}\" through proxy: {1}", new Object[] { sourceUri, this }); sourceUri = Val.chkStr(sourceUri).replaceAll("\\{", "%7B").replaceAll("\\}", "%7D"); HttpClientRequest cr = new HttpClientRequest(); cr.setBatchHttpClient(this.info.getBatchHttpClient()); cr.setUrl(sourceUri);/*from ww w . j a va 2s . co m*/ StringHandler sh = new StringHandler(); cr.setContentHandler(sh); cr.setCredentialProvider(info.newCredentialProvider()); cr.execute(); String mdText = sh.getContent(); LOGGER.log(Level.FINER, "Received metadata of source URI: \"{0}\" through proxy: {1}", new Object[] { sourceUri, this }); LOGGER.finest(mdText); return mdText; }
From source file:name.richardson.james.bukkit.alias.persistence.PlayerNameRecordManager.java
public void save(PlayerNameRecord playerNameRecord) { logger.log(Level.FINER, "Saving {0}", playerNameRecord.toString()); database.save(playerNameRecord); }
From source file:edu.wpi.cs.wpisuitetng.modules.core.entitymanagers.ProjectManager.java
@Override public Project makeEntity(Session s, String content) throws WPISuiteException { User theUser = s.getUser();/* ww w .j a v a 2s . c om*/ logger.log(Level.FINER, "Attempting new Project creation..."); Project p; try { p = Project.fromJSON(content); } catch (JsonSyntaxException e) { logger.log(Level.WARNING, "Invalid Project entity creation string."); throw new BadRequestException( "The entity creation string had invalid format. Entity String: " + content); } logger.log(Level.FINE, "New project: " + p.getName() + " submitted by: " + theUser.getName()); p.setOwner(theUser); if (getEntity(s, p.getIdNum())[0] == null) { if (getEntityByName(s, p.getName())[0] == null) { save(s, p); } else { logger.log(Level.WARNING, "Project Name Conflict Exception during Project creation."); throw new ConflictException( "A project with the given name already exists. Entity String: " + content); } } else { logger.log(Level.WARNING, "ID Conflict Exception during Project creation."); throw new ConflictException("A project with the given ID already exists. Entity String: " + content); } logger.log(Level.FINER, "Project creation success!"); return p; }
From source file:SuperPeer.java
@Override public synchronized Key getSuccessor(Key nodeid) throws Exception { lg.log(Level.FINEST, "getSuccessor Entry."); Iterator<PeerInfo> it = peertable.iterator(); PeerInfo fe = null;//from w ww .j av a 2s.c o m // Find the first peer key greater than the provided one. while (it.hasNext()) { fe = it.next(); if (fe.getNodeId().compare(nodeid) > 0) break; fe = null; } // This means that either the peertable is empty or // nodeid provided is higher than all other peers. if (fe == null) { lg.log(Level.FINER, "getSuccessor - Highest nodeid or peertable empty try the first entry."); it = peertable.iterator(); if (it.hasNext()) { fe = it.next(); if (fe.getNodeId().compare(nodeid) == 0) fe = null; } } Key rv = null; if (fe != null) rv = fe.getNodeId(); else lg.log(Level.FINER, "getSuccessor - No successor found, table must be empty.."); lg.log(Level.FINEST, "getSuccessor Exit."); return rv; }
From source file:com.ibm.jaggr.core.impl.modulebuilder.less.LessModuleBuilder.java
protected void init() { final String sourceMethod = "init"; //$NON-NLS-1$ final boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(sourceClass, sourceMethod); }//from w ww. java2 s . c o m Context cx = Context.enter(); try { cx.setOptimizationLevel(9); InputStream in = CSSModuleBuilder.class.getClassLoader().getResourceAsStream(LESS_JS_RES); if (in == null) { throw new NotFoundException(LESS_JS_RES); } String lessJsSource = IOUtils.toString(in); lessJsScript = cx.compileString(lessJsSource, LESS_JS_RES, 1, null); compilerScript = cx.compileString(compilerString, BLANK, 1, null); } catch (IOException e) { throw new RuntimeException(e); } finally { Context.exit(); } if (isTraceLogging) { log.exiting(sourceMethod, sourceMethod); } }
From source file:com.esri.gpt.control.webharvest.client.dcat.DCATQueryBuilder.java
@Override public Query newQuery(Criteria crt) { Query q = new DCATQuery(context, info, crt); LOGGER.log(Level.FINER, "Query created: {0}", q); return q;/* w w w .j ava 2 s . c o m*/ }
From source file:org.b3log.latke.cron.Cron.java
@Override public void run() { LOGGER.finer("Executing scheduled task...."); final URLFetchService urlFetchService = URLFetchServiceFactory.getURLFetchService(); final HTTPRequest request = new HTTPRequest(); try {/*from ww w . j av a2s. c om*/ request.setURL(new URL(url)); request.setRequestMethod(HTTPRequestMethod.GET); urlFetchService.fetchAsync(request); LOGGER.log(Level.FINER, "Executed scheduled task[url={0}]", url); } catch (final Exception e) { LOGGER.log(Level.SEVERE, "Scheduled task execute failed", e); } }
From source file:org.cloudifysource.esc.driver.provisioning.openstack.OpenStackNovaClient.java
/** * List existing servers./*from w w w . j a va2s. c o m*/ * * @return A list of existing servers. * @throws OpenstackException * Thrown when a problem occurs with the request. */ public List<NovaServer> getServers() throws OpenstackException { if (logger.isLoggable(Level.FINER)) { logger.log(Level.FINER, "Request=getServerDetails"); } final String response = this.doGet("servers"); final List<NovaServer> list = JsonUtils.unwrapRootToList(NovaServer.class, response); return list; }
From source file:org.geoserver.ManifestLoader.java
/** * @throws Exception /*from www . ja va 2 s .c o m*/ * */ public ManifestLoader(GeoServerResourceLoader loader) throws Exception { classLoader = loader.getClassLoader(); props = new Properties(); // load from jar or classpath InputStream is = null; try { is = classLoader.getResourceAsStream("org/geoserver/" + PROPERTIES_FILE); if (is != null) { props.load(is); } } catch (IOException e) { LOGGER.log(Level.FINER, e.getMessage(), e); } finally { IOUtils.closeQuietly(is); } // override settings from datadir try { // datadir search File properties = loader.find(PROPERTIES_FILE); if (properties != null) { is = new FileInputStream(properties); props.load(is); } } catch (IOException e2) { LOGGER.log(Level.FINER, e2.getMessage(), e2); } finally { IOUtils.closeQuietly(is); } try { resourceNameRegex = Pattern.compile(props.getProperty(RESOURCE_NAME_REGEX) + "!/META-INF/MANIFEST.MF"); } catch (PatternSyntaxException e) { LOGGER.log(java.util.logging.Level.SEVERE, e.getLocalizedMessage(), e); throw e; } String ae = props.getProperty(RESOURCE_ATTRIBUTE_EXCLUSIONS); if (ae != null) { resourceAttributeExclusions = ae.split(","); } else { resourceAttributeExclusions = new String[0]; } String ai = props.getProperty(VERSION_ATTRIBUTE_INCLUSIONS); if (ai != null) { versionAttributeInclusions = ai.split(","); } else { // defaults throw new Exception("Include attribute array cannot be null"); } }