Example usage for org.apache.commons.logging Log info

List of usage examples for org.apache.commons.logging Log info

Introduction

In this page you can find the example usage for org.apache.commons.logging Log info.

Prototype

void info(Object message);

Source Link

Document

Logs a message with info log level.

Usage

From source file:org.jboss.netty.logging.CommonsLoggerTest.java

@Test
public void testInfo() {
    org.apache.commons.logging.Log mock = createStrictMock(org.apache.commons.logging.Log.class);

    mock.info("a");
    replay(mock);//  w w  w .  jav a2s . c o  m

    InternalLogger logger = new CommonsLogger(mock, "foo");
    logger.info("a");
    verify(mock);
}

From source file:org.jboss.test.classloader.leak.ejb.bean.StatefulSessionBean.java

public void log(String category) {
    Log log = LogFactory.getLog(category);
    log.info("Logging for " + getClass().getName());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB2_SFSB_TCCL",
            Thread.currentThread().getContextClassLoader());
}

From source file:org.jboss.test.classloader.leak.ejb.bean.StatelessSessionBean.java

public void log(String category) {
    Log log = LogFactory.getLog(category);
    log.info("Logging for " + getClass().getName());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB2_SLSB_TCCL",
            Thread.currentThread().getContextClassLoader());
}

From source file:org.jboss.test.classloader.leak.ejb3.Ejb3StatefulSessionBean.java

public void log(String category) {
    Log log = LogFactory.getLog(category);
    log.info("Logging for " + getClass().getName());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SFSB",
            Ejb3StatefulSessionBean.class.getClassLoader());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SFSB_TCCL",
            Thread.currentThread().getContextClassLoader());
}

From source file:org.jboss.test.classloader.leak.ejb3.Ejb3StatelessSessionBean.java

public void log(String category) {
    Log log = LogFactory.getLog(category);
    log.info("Logging for " + getClass().getName());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SLSB",
            Ejb3StatelessSessionBean.class.getClassLoader());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_SLSB_TCCL",
            Thread.currentThread().getContextClassLoader());
}

From source file:org.jboss.test.classloader.leak.ejb3.ThreadLocalPoolEjb3StatelessSessionBean.java

public void log(String category) {
    Log log = LogFactory.getLog(category);
    log.info("Logging for " + getClass().getName());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("EJB3_TLP_SLSB",
            ThreadLocalPoolEjb3StatelessSessionBean.class.getClassLoader());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance()
            .storeClassLoader("EJB3_TLP_SLSB_TCCL", Thread.currentThread().getContextClassLoader());
}

From source file:org.jboss.test.classloader.leak.web.SimpleServlet.java

protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("SERVLET",
            Thread.currentThread().getContextClassLoader());
    org.jboss.test.classloader.leak.clstore.ClassLoaderStore.getInstance().storeClassLoader("SERVLET_TCCL",
            Thread.currentThread().getContextClassLoader());

    Log log = LogFactory.getLog("WEBAPP");
    log.info("Logging from " + getClass().getName());

    res.setContentType("text/text");
    PrintWriter writer = res.getWriter();
    writer.println("WEBAPP");
    writer.flush();// www  . j a v a2 s .co m
}

From source file:org.jkcsoft.java.util.JndiHelper.java

public static void logLevel(Log plog, int level, int nth, String msg) {
    plog.info(Strings.multiplyString("\t", level) + "Dir Entry [" + nth + "]: " + msg);
}

From source file:org.jkcsoft.java.util.OsHelper.java

public static void runOsCommand(String command, Log log) throws IOException {
    try {/*w w  w  . j a  v a  2s.  c  o  m*/

        Runtime rt = Runtime.getRuntime();
        Process p = rt.exec(command);

        BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));

        BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));

        // read the output from the command

        log.info("Here is the standard output of the command:");
        String stLine = null;
        while ((stLine = stdInput.readLine()) != null) {
            log.info(stLine);
        }

        // read any errors from the attempted command
        log.info("Here is the standard error of the command (if any):");
        while ((stLine = stdError.readLine()) != null) {
            log.info(stLine);
        }
    } catch (IOException e) {
        log.error("running OS command", e);
        throw e;
    }
}

From source file:org.jkcsoft.java.util.OsHelper.java

public static boolean isExecutable(File file, Log log) throws Exception {
    boolean is = true;

    if (isLinux()) {
        // e.g., /usr/bin/test -x /home/coles/build/build-tsess.sh && echo yes || echo no
        try {//from  ww w  .  j a va 2  s .  c o m

            Runtime rt = Runtime.getRuntime();
            String stTest = "/usr/bin/test -x " + file.getAbsolutePath() + " && echo yes || echo no";
            log.debug("Command=" + stTest);

            Process p = rt.exec(stTest);

            BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));

            BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));

            String stLine = null;

            // read any errors from the attempted command
            log.info("Here is the standard error of the command (if any):");
            while ((stLine = stdError.readLine()) != null) {
                log.warn(stLine);
            }

            // read the output from the command
            StringBuilder sbResponse = new StringBuilder();
            while ((stLine = stdInput.readLine()) != null) {
                sbResponse.append(stLine);
            }

            is = "yes".equalsIgnoreCase(sbResponse.toString());

        } catch (IOException e) {
            log.error("In isExecutable()", e);
            throw e;
        }
    } else {
        log.info("Not Linux -- assume executable");
    }

    return is;
}