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:edu.harvard.hms.dbmi.bd2k.irct.monitoring.event.action.MonitoringBeforeProcess.java

public void init(Map<String, String> parameters) {
    log = LogFactory.getLog("Action Monitoring");
}

From source file:com.saake.invoicer.util.Resources.java

@Produces
public Log getLog(InjectionPoint injectionPoint) {
    System.out.println("Inside getLog:");
    System.out.println("injectionPoint:" + injectionPoint.toString());
    return LogFactory.getLog(injectionPoint.getMember().getDeclaringClass().getName());
}

From source file:com.github.veithen.ulog.itest.slf4j.nop.Test.java

public void testCommonsLogging() {
    assertEquals("org.apache.commons.logging.impl.NoOpLog", LogFactory.getLog("test").getClass().getName());
}

From source file:net.sourceforge.eclipsetrader.core.internal.LogListener.java

public void logging(IStatus status, String plugin) {
    Log log = LogFactory.getLog(plugin);
    switch (status.getSeverity()) {
    case IStatus.INFO:
        log.info(status.getMessage(), status.getException());
        break;/*from  ww  w. j  ava2 s .  com*/
    case IStatus.WARNING:
        log.warn(status.getMessage(), status.getException());
        break;
    case IStatus.ERROR:
        log.error(status.getMessage(), status.getException());
        break;
    default:
        log.debug(status.getMessage(), status.getException());
        break;
    }
}

From source file:com.gf.components.log.apache.ApacheLogProvider.java

public Log getLog(Class<?> clazz) {
    org.apache.commons.logging.Log original = LogFactory.getLog(clazz);
    return new LogImpl(original);
}

From source file:edu.vt.middleware.ldap.ssl.SingletonTLSSocketFactory.java

/**
 * This returns the default SSL socket factory.
 *
 * @return  <code>SocketFactory</code>
 *///w  ww .j  a va2s  .c om
public static SocketFactory getDefault() {
    final SingletonTLSSocketFactory sf = new SingletonTLSSocketFactory();
    try {
        sf.initialize();
    } catch (GeneralSecurityException e) {
        final Log logger = LogFactory.getLog(SingletonTLSSocketFactory.class);
        if (logger.isErrorEnabled()) {
            logger.error("Error initializing socket factory", e);
        }
    }
    return sf;
}

From source file:com.ibatis.common.logging.jakarta.JakartaCommonsLoggingImpl.java

public JakartaCommonsLoggingImpl(Class clazz) {
    log = LogFactory.getLog(clazz);
}

From source file:com.amazon.carbonado.repo.jdbc.LoggingDataSource.java

/**
 * Wraps the given DataSource which logs to the given log. If debug logging
 * is disabled, the original DataSource is returned.
 *//* w ww  .  j ava2  s .c  o m*/
public static DataSource create(DataSource ds, Log log) {
    if (ds == null) {
        throw new IllegalArgumentException();
    }
    if (log == null) {
        log = LogFactory.getLog(LoggingDataSource.class);
    }
    if (!log.isDebugEnabled()) {
        return ds;
    }
    return new LoggingDataSource(log, ds);
}

From source file:gridool.GridMain.java

private static void shutdown(final GridServer grid, final Throwable e) {
    String errmsg = "Failed to start grid: " + e.getMessage();
    LogFactory.getLog(GridMain.class).error(errmsg, e);
    System.err.println(errmsg);//from ww w . j av a 2 s .  c  o m
    try {
        grid.shutdown(true);
    } catch (RemoteException re) {
        ;
    }
}

From source file:com.gf.components.log.apache.LogFactoryTest.java

@Test
public void test_same_of_instances() {

    Log log1 = LogFactory.getLog(LogFactoryTest.class);
    Log log2 = LogFactory.getLog(LogFactoryTest.class);

    assertSame(log1, log2);/*from   w w  w .ja  v a2s.  co  m*/
}