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.util.Statistics.java
/** * Removes the expired online visitor.//from w w w .j a v a 2 s . c o m */ public static void removeExpiredOnlineVisitor() { final long currentTimeMillis = System.currentTimeMillis(); final Iterator<Entry<String, Long>> iterator = ONLINE_VISITORS.entrySet().iterator(); while (iterator.hasNext()) { final Entry<String, Long> onlineVisitor = iterator.next(); if (currentTimeMillis > (onlineVisitor.getValue() + ONLINE_VISITOR_EXPIRATION)) { iterator.remove(); LOGGER.log(Level.FINEST, "Removed online visitor[ip={0}]", onlineVisitor.getKey()); } } LOGGER.log(Level.FINER, "Current online visitor count [{0}]", ONLINE_VISITORS.size()); }
From source file:org.jenkinsci.plugins.dockerhub.notification.Coordinator.java
@Override public void onStarted(@Nonnull Run<?, ?> run, @Nonnull TaskListener listener) { DockerHubWebHookCause cause = run.getCause(DockerHubWebHookCause.class); if (cause != null) { logger.log(Level.FINER, "Build {0} started for cause: {1}", new Object[] { run.getFullDisplayName(), cause }); TriggerStore.getInstance().started(cause.getPayload(), run); }//www .ja va2 s . c om }
From source file:org.jenkinsci.plugins.quayio.trigger.QuayIoWebHook.java
@RequirePOST @RespondSuccess// w w w . j av a 2 s . c om public void doPush(StaplerRequest request, StaplerResponse response) throws IOException { PushEventNotification notification; String body = IOUtils.toString(request.getInputStream(), request.getCharacterEncoding()); try { JSONObject payload = JSONObject.fromObject(body); notification = new PushEventNotification(payload); } catch (Exception e) { logger.log(Level.SEVERE, "Could not parse the web hook payload!", e); logger.log(Level.FINER, "Payload content: " + body); return; } if (notification != null) { trigger(response, notification); } }
From source file:com.esri.gpt.control.webharvest.client.thredds.TProxy.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 w ww . j a v a2s . co m*/ StringHandler sh = new StringHandler(); cr.setContentHandler(sh); 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:com.ibm.jaggr.service.util.BundleVersionsHashBase.java
/** * Returns the bundle headers for the specified bundle. * * @param bundleName//from w w w. j a va2s . c om * the bundle name * @return the bundle headers for the bundle. * @throws NotFoundException if no matching bundle is found. */ private Dictionary<?, ?> getBundleHeaders(String bundleName) throws NotFoundException { final String sourceMethod = "getBundleHeaders"; //$NON-NLS-1$ boolean isTraceLogging = log.isLoggable(Level.FINER); if (isTraceLogging) { log.entering(BundleVersionsHashBase.class.getName(), sourceMethod, new Object[] { bundleName }); } Bundle result = ".".equals(bundleName) ? contributingBundle : bundleResolver.getBundle(bundleName); //$NON-NLS-1$ if (result == null) { throw new NotFoundException("Bundle " + bundleName + " not found."); //$NON-NLS-1$ //$NON-NLS-2$ } if (isTraceLogging) { log.exiting(BundleVersionsHashBase.class.getName(), sourceMethod, result.getHeaders()); } return result.getHeaders(); }
From source file:Peer.java
/** * The peer constructor.//w w w .j a v a 2 s . com */ public Peer(String sp) throws Exception { try { // Initialize of various members pred = null; succ = null; lock = false; // Find the SuperPeer superpeer = (SuperPeerInterface) Naming.lookup("//" + sp + "/SuperPeer"); // Initialize the node cache peercache = new HashMap<Key, PeerInterface>(); // Initialize word map dict = new HashMap<String, String>(); //////////////////////////////////////////////// // BEGIN CRITICAL SECTION // only one peer will be in this code at a time. superpeer.lock(); // Get this Peer's NodeID nodeid = superpeer.join(); //Start logger lg = new Logger("Peer:" + nodeid.toString()); lg.log(Level.FINER, "Peer started."); // Register with the RMI Registry. lg.log(Level.FINER, "Binding to local RMI registry with name " + nodeid.toString()); Naming.rebind(nodeid.toString(), this); // Get Successor succ = superpeer.getSuccessor(nodeid); // Get hasher lg.log(Level.FINER, "Retrieving Hash object"); hasher = superpeer.getHasher(); // Set mbits int mbits = hasher.getBitSize(); // Initialize finger table ft = new FingerTable(nodeid.succ(), nodeid); // Update finger table constructFingerTable(mbits); lock = true; // If we have a successor, start the notify cycle if (succ != null) { lg.log(Level.FINER, "Calling " + succ.toString()); getPeer(succ).notify(nodeid); } lock = false; superpeer.unlock(); // END CRITICAL SECTION //////////////////////////////////////////////// lg.log(Level.FINER, "Exit Critical Section"); lg.log(Level.INFO, "!!!! Peer " + nodeid + " at " + superpeer.getAddress(nodeid) + " started !!!!"); } catch (Exception e) { e.printStackTrace(); } }
From source file:com.marvelution.hudson.plugins.jirareporter.JIRAChangeLogAnnotator.java
/** * {@inheritDoc}/*www. java 2 s.c o m*/ */ @Override public void annotate(AbstractBuild<?, ?> build, Entry change, MarkupText text) { if (!JIRASite.hasSite(build)) { // The project of this build is not configured with the JIRABuildResultReportNotifier so skip // changelog annotation return; } final Map<String, RemoteIssue> knownIssues = new HashMap<String, RemoteIssue>(); final JIRASite site = JIRASite.getSite(build); if (site.checkIssueExistence) { // Checking for existing Issue Keys, loop through the message and get all the existing issues with one call JIRAClient client = null; try { client = site.createClient(); List<String> keys = new ArrayList<String>(); Matcher matcher = site.getIssuePattern().matcher(text.getText()); while (matcher.find()) { keys.add(matcher.group(0)); } if (!keys.isEmpty()) { String jqlQuery = "issuekey in (" + StringUtils.join(keys, ",") + ")"; LOGGER.log(Level.FINER, "Searching with JQL: " + jqlQuery); for (RemoteIssue issue : client.getIssuesFromJqlSearch(jqlQuery, keys.size())) { LOGGER.log(Level.FINEST, "Found: " + issue.getKey()); knownIssues.put(issue.getKey().toUpperCase(), issue); } } } catch (Exception e) { LOGGER.log(Level.FINER, "Unable to check the existence of one or more issues"); } finally { if (client != null) { client.logout(); } } } for (SubText token : text.findTokens(site.getIssuePattern())) { if (site.checkIssueExistence) { // Check is the issue exists before annotating it // Checked issue keys are stored in uppercase final String issueKey = token.group(0).toUpperCase(); if (knownIssues.containsKey(issueKey)) { RemoteIssue issue = knownIssues.get(issueKey); token.surroundWith(String.format("<a href='%sbrowse/%s' tooltip='%s'>", site.url, issue.getKey(), Util.escape(issue.getSummary())), "</a>"); } else { LOGGER.log(Level.FINER, "Key " + token.group(0) + " was not found, skipping it"); } } else { // Issue existence check disabled, just assume its there token.surroundWith(String.format("<a href='%sbrowse/%s'>", site.url, token.group(0)), "</a>"); } } }
From source file:org.b3log.solo.event.symphony.CommentSender.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 a va2 s .c om*/ final JSONObject originalComment = data.getJSONObject(Comment.COMMENT); 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 comment[id={0}] to Symphony", new Object[] { originalComment.getString(Keys.OBJECT_ID) }); return; } final HTTPRequest httpRequest = new HTTPRequest(); httpRequest.setURL(ADD_COMMENT_URL); httpRequest.setRequestMethod(HTTPRequestMethod.PUT); final JSONObject requestJSONObject = new JSONObject(); final JSONObject comment = new JSONObject(); comment.put("commentId", originalComment.optString(Keys.OBJECT_ID)); comment.put("commentAuthorName", originalComment.getString(Comment.COMMENT_NAME)); comment.put("commentAuthorEmail", originalComment.getString(Comment.COMMENT_EMAIL)); comment.put(Comment.COMMENT_CONTENT, originalComment.getString(Comment.COMMENT_CONTENT)); comment.put("articleId", originalComment.getString(Comment.COMMENT_ON_ID)); requestJSONObject.put(Comment.COMMENT, comment); requestJSONObject.put("clientVersion", SoloServletListener.VERSION); requestJSONObject.put("clientRuntimeEnv", Latkes.getRuntimeEnv().name()); requestJSONObject.put("clientName", "B3log Solo"); requestJSONObject.put("clientHost", blogHost); requestJSONObject.put("clientAdminEmail", preference.optString(Preference.ADMIN_EMAIL)); requestJSONObject.put("userB3Key", preference.optString(Preference.KEY_OF_SOLO)); httpRequest.setPayload(requestJSONObject.toString().getBytes("UTF-8")); urlFetchService.fetchAsync(httpRequest); } catch (final Exception e) { LOGGER.log(Level.SEVERE, "Sends a comment to Symphony error: {0}", e.getMessage()); } LOGGER.log(Level.FINER, "Sent a comment to Symphony"); }
From source file:com.wolvencraft.yasp.db.ScriptRunner.java
/** * Executes a database script/* ww w. j av a2s . co m*/ * * @param reader Reader * @throws RuntimeSQLException thrown if an error occurs while executing a line */ public void runScript(Reader reader) throws RuntimeSQLException { Message.log(Level.FINER, "Executing a database script"); try { StringBuilder command = new StringBuilder(); try { BufferedReader lineReader = new BufferedReader(reader); int i = 0; String line = ""; String dbName = LocalConfiguration.DBName.toString(); String dbPrefix = LocalConfiguration.DBPrefix.toString(); boolean debug = LocalConfiguration.Debug.toBoolean(); while ((line = lineReader.readLine()) != null) { line = StringUtils.replace(line, "$dbname", dbName); line = StringUtils.replace(line, "$prefix_", dbPrefix); command = this.handleLine(command, line); i++; if (i % 50 == 0 && debug) Message.log(Level.FINEST, "Executing line " + i); } Message.log(Level.FINER, "Executed " + i + " lines total"); this.commitConnection(); this.checkForMissingLineTerminator(command); } catch (Exception e) { String message = "Error executing: " + command + ". Cause: " + e; throw new RuntimeSQLException(message, e); } } finally { this.rollbackConnection(); } }
From source file:jext2.JextReentrantReadWriteLock.java
private void logIfLoggable(String message) { if (logger.isLoggable(Level.FINER)) { log(message); } }