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:fr.aliasource.webmail.folder.ActionCreateFolderAction.java

public ActionCreateFolderAction() {
    logger = LogFactory.getLog(getClass());
}

From source file:fr.aliasource.webmail.folder.ActionRenameFolderAction.java

public ActionRenameFolderAction() {
    logger = LogFactory.getLog(getClass());
}

From source file:com.acciente.induction.init.ViewResolverInitializer.java

public static ViewResolver getViewResolver(Config.ViewResolver oViewResolverConfig,
        Config.ViewMapping oViewMappingConfig, ModelPool oModelPool, ClassLoader oClassLoader,
        ServletConfig oServletConfig)/*w  ww.  j  ava2 s. co  m*/
        throws ClassNotFoundException, InvocationTargetException, ConstructorNotFoundException,
        ParameterProviderException, IllegalAccessException, InstantiationException, IOException {
    ViewResolver oViewResolver;
    String sViewResolverClassName;
    Log oLog;

    oLog = LogFactory.getLog(ViewResolverInitializer.class);

    sViewResolverClassName = oViewResolverConfig.getClassName();

    if (Strings.isEmpty(sViewResolverClassName)) {
        oViewResolver = new ShortURLViewResolver(oViewMappingConfig, oClassLoader);
    } else {
        oLog.info("loading user-defined view resolver: " + sViewResolverClassName);

        Class oViewResolverClass = oClassLoader.loadClass(sViewResolverClassName);

        // attempt to find and call the single public constructor
        oViewResolver = (ViewResolver) ObjectFactory.createObject(oViewResolverClass,
                new Object[] { oServletConfig, oViewResolverConfig, oViewMappingConfig, oClassLoader },
                new InitializerParameterProvider(oModelPool, "view-resolver-init"));
    }

    return oViewResolver;
}

From source file:com.springsource.insight.plugin.logging.CommonsLoggingOperationCollectionAspectTest.java

@Test
public void testLogErrorMessage() {
    String msg = "testLogErrorMessage";
    Log logger = LogFactory.getLog(getClass());
    logger.error(msg);/*from   w  ww  .  ja  v a 2s . c om*/
    assertLoggingOperation(Log.class, "ERROR", msg, null);
}

From source file:com.miraclelinux.historygluon.ExecTimeObserver.java

public ExecTimeObserver(String header) {
    m_log = LogFactory.getLog(ExecTimeObserver.class);
    m_threadId = Thread.currentThread().getId();
    m_logHeader = header + "(" + m_threadId + ") : ";
}

From source file:com.amazonaws.util.Md5Utils.java

/**
 * Computes the MD5 hash of the data in the given input stream and returns
 * it as an array of bytes./*from w  w w .j a  va2  s. co m*/
 * Note this method closes the given input stream upon completion.
 */
public static byte[] computeMD5Hash(InputStream is) throws IOException {
    BufferedInputStream bis = new BufferedInputStream(is);
    try {
        MessageDigest messageDigest = MessageDigest.getInstance("MD5");
        byte[] buffer = new byte[SIXTEEN_K];
        int bytesRead;
        while ((bytesRead = bis.read(buffer, 0, buffer.length)) != -1) {
            messageDigest.update(buffer, 0, bytesRead);
        }
        return messageDigest.digest();
    } catch (NoSuchAlgorithmException e) {
        // should never get here
        throw new IllegalStateException(e);
    } finally {
        try {
            bis.close();
        } catch (Exception e) {
            LogFactory.getLog(Md5Utils.class).debug("Unable to close input stream of hash candidate: " + e);
        }
    }
}

From source file:com.xpandit.fusionplugin.pentaho.content.FusionContentGenerator.java

@Override
public Log getLogger() {
    return LogFactory.getLog(FusionContentGenerator.class);
}

From source file:com.ai.cloud.io.netty.util.internal.logging.CommonsLoggerFactory.java

@Override
public InternalLogger newInstance(String name) {
    return new CommonsLogger(LogFactory.getLog(name), name);
}

From source file:fr.aliasource.index.core.AbstractCrawler.java

protected AbstractCrawler() {
    this.logger = LogFactory.getLog(getClass());
    this.toCrawl = new LinkedBlockingQueue<String>();
}

From source file:epgtools.loggerfactory.LoggerFactoryTest.java

/**
 * Test of getLOG method, of class LoggerFactory.
 *//*from   w  ww .  ja v a 2  s .  c o  m*/
@Test
public void testGetLOG() {
    MAIN_LOG.info("getLOG");
    LoggerFactory instance = new LoggerFactory(this.getClass(), true);
    Log expResult = LogFactory.getLog(this.getClass());
    Log result = instance.getLOG();

    //?????????
    expResult.info("Message from expResult.");
    result.info("Message from result.");

    assertEquals(expResult, result);
}