Example usage for org.apache.commons.logging LogFactory getLog

List of usage examples for org.apache.commons.logging LogFactory getLog

Introduction

In this page you can find the example usage for org.apache.commons.logging LogFactory getLog.

Prototype

public static Log getLog(String name) 

Source Link

Document

Convenience method to return a named logger.

Usage

From source file:net.sf.j2ep.servers.ClusterContainer.java

/**
 * Basic constructor//from  w  w w  .  ja v  a  2  s .  com
 */
public ClusterContainer() {
    servers = new HashMap();
    statusChecker = new ServerStatusChecker(this, 5 * 60 * 1000);
    statusChecker.start();
    log = LogFactory.getLog(ClusterContainer.class);
}

From source file:net.sf.nmedit.jtheme.component.misc.CallDescriptor.java

private Method getMethod(JTComponent target) {
    if (tmethod == null) {
        try {/*  w ww  .  j  a va2 s .  com*/
            tmethod = target.getClass().getDeclaredMethod(method, new Class[0]);
        } catch (Exception e) {
            Log l = LogFactory.getLog(getClass());
            if (l.isDebugEnabled())
                l.debug("Method not found: " + method, e);
        }
    }
    return tmethod;
}

From source file:net.sf.housekeeper.swing.LoadCommand.java

protected void doExecuteCommand() {
    Assert.notNull(importExportController);

    try {//from   ww  w . j a v  a2 s  . c  o m
        importExportController.importData();
        LogFactory.getLog(getClass()).info("Data sucessfully loaded");
    } catch (FileNotFoundException exception) {

        final MessageDialog dialog = MessageFactory.INSTANCE.createErrorMessageDialog("gui.mainFrame.nodata",
                exception);
        dialog.showDialog();
    } catch (Exception exception) {
        final MessageDialog dialog = MessageFactory.INSTANCE.createErrorMessageDialog(exception);
        dialog.showDialog();
    }
}

From source file:edu.ucsb.nceas.mdqengine.solr.XMLtoJSON.java

@Override
public List<SolrElementField> getFields(Document doc, String identifier) throws Exception {
    List<SolrElementField> fields = new ArrayList<SolrElementField>();
    String xmlString = null;/*from   w  ww. j  a  v  a 2  s .  c  o  m*/
    String jsonString = null;
    Log log = LogFactory.getLog(XMLtoJSON.class);

    // Convert the document that is being indexed to an XML string, then to a JSON string.
    // The field is stored as JSON so that it will be easy to parse by clients.
    try {
        DOMSource domSource = new DOMSource(doc);
        StringWriter writer = new StringWriter();
        StreamResult result = new StreamResult(writer);
        TransformerFactory tf = TransformerFactory.newInstance();
        Transformer transformer = tf.newTransformer();
        transformer.transform(domSource, result);
        xmlString = writer.toString();

        JSONObject xmlJSONObj = XML.toJSONObject(xmlString);
        jsonString = xmlJSONObj.toString();
    } catch (TransformerException ex) {
        ex.printStackTrace();
        log.error("Error processing field " + this.name + ": " + ex.getMessage());
        return fields;
    } catch (JSONException je) {
        log.error("Error processing field " + this.name + ": " + je.getMessage());
        return fields;
    }

    fields.add(new SolrElementField(this.name, jsonString));
    return fields;
}

From source file:eu.openanalytics.rsb.config.RServiEnvironmentServletContextListener.java

@Override
public void contextInitialized(final ServletContextEvent sce) {
    ECommons.init("de.walware.rj.services.eruntime", this);
    logger = LogFactory.getLog("de.walware.rj.servi.pool");

    RjsComConfig.setProperty("rj.servi.graphicFactory", new RClientGraphicFactory() {
        @Override/*w  w  w.  j  a  v  a 2s  .c  o m*/
        public Map<String, ? extends Object> getInitServerProperties() {
            return null;
        }

        @Override
        public RClientGraphic newGraphic(final int devId, final double w, final double h,
                final InitConfig config, final boolean active, final RClientGraphicActions actions,
                final int options) {
            return new RClientGraphicDummy(devId, w, h);
        }

        @Override
        public void closeGraphic(final RClientGraphic graphic) {
            // NOOP
        }
    });
}

From source file:com.adaptris.transport.JunitSocketServer.java

public JunitSocketServer() throws Exception {
    if (logR == null) {
        logR = LogFactory.getLog(JunitSocketServer.class);
    }/*from  w ww.  j a v  a2 s.  c  o  m*/
    if (SOCKET_PROPERTIES.isEmpty()) {
        throw new Exception("No Properties");
    }
    tcp = new SocketServer(SOCKET_PROPERTIES, "tcp");
    ssl = new SocketServer(SOCKET_PROPERTIES, "ssl");
}

From source file:com.brienwheeler.lib.io.ReconnectingSocket.java

public ReconnectingSocket(String hostname, int port) {
    this(hostname, port, LogFactory.getLog(ReconnectingSocket.class));
}

From source file:com.github.lpezet.antiope.metrics.TimingInfoFullSupport.java

@Override
public void addSubMeasurement(String pSubMeasurementName, TimingInfo pTI) {
    List<TimingInfo> timings = mSubMeasurementsByName.get(pSubMeasurementName);
    if (timings == null) {
        timings = new ArrayList<TimingInfo>();
        mSubMeasurementsByName.put(pSubMeasurementName, timings);
    }/* w  ww.java2s.  c o m*/
    if (pTI.isEndTimeKnown()) {
        timings.add(pTI);
    } else {
        LogFactory.getLog(getClass())
                .debug("Skip submeasurement timing info with no end time for " + pSubMeasurementName);
    }
}

From source file:com.qmetry.qaf.automation.ui.webdriver.QAFWebComponent.java

public QAFWebComponent(String locator) {
    super(locator);
    logger = LogFactory.getLog(this.getClass());
    initFields();
}