Skip to content

Commit

Permalink
Added some debug logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
csrster committed Aug 5, 2016
1 parent 9a0aa38 commit 2404ae8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Expand Up @@ -38,6 +38,9 @@
import javax.management.ObjectName;
import javax.management.RuntimeMBeanException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import dk.netarkivet.common.exceptions.ArgumentNotValid;
import dk.netarkivet.common.utils.ExceptionUtils;
import dk.netarkivet.common.utils.I18n;
Expand All @@ -49,6 +52,10 @@
* Implementation of StatusEntry, that receives its data from the MBeanServer (JMX).
*/
public class JMXStatusEntry implements StatusEntry {

private static final Logger log = LoggerFactory.getLogger(JMXStatusEntry.class);


/** The ObjectName assigned to the MBean for this JMXStatusEntry. */
private ObjectName mBeanName;
/** JMX Query to retrieve the logmessage associated with this Entry. */
Expand Down Expand Up @@ -293,11 +300,13 @@ public static List<StatusEntry> queryJMX(String query) throws MalformedObjectNam
HostForwarding.getInstance(SingleLogRecord.class, mBeanServer, LOGGING_QUERY);
// The "null" in this case is used to indicate no further filters on the
// query.
log.debug("Querying " + mBeanServer.toString());
Set<ObjectName> resultSet = mBeanServer.queryNames(new ObjectName(query), null);
for (ObjectName objectName : resultSet) {
entries.add(new JMXStatusEntry(objectName));
}
Collections.sort(entries);
log.debug("Query returned " + entries.size() + " results.");
return entries;
}

Expand Down
Expand Up @@ -36,6 +36,9 @@
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import dk.netarkivet.common.exceptions.ArgumentNotValid;
import dk.netarkivet.common.exceptions.ForwardedToErrorPage;
import dk.netarkivet.common.utils.DomainUtils;
Expand All @@ -51,6 +54,10 @@
* Monitor-JMXsummary.jsp.
*/
public class JMXSummaryUtils {

private static final Logger log = LoggerFactory.getLogger(JMXSummaryUtils.class);


/** JMX property for remove application button. */
public static final String JMXRemoveApplication = dk.netarkivet.common.management.Constants.REMOVE_JMX_APPLICATION;
/** JMX property for the physical location. */
Expand Down Expand Up @@ -281,6 +288,7 @@ public static List<StatusEntry> queryJMXFromRequest(String[] parameters, Starred
String query = null;
try {
query = createJMXQuery(parameters, request);
log.debug("Executing JMX query: " + query);
return JMXStatusEntry.queryJMX(query);
} catch (MalformedObjectNameException e) {
if (query != null) {
Expand Down

0 comments on commit 2404ae8

Please sign in to comment.