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.vt.middleware.ldap.ssl.SingletonTLSSocketFactory.java

/** {@inheritDoc} */
public void setSSLContextInitializer(final SSLContextInitializer initializer) {
    if (staticContextInitializer != null) {
        final Log logger = LogFactory.getLog(SingletonTLSSocketFactory.class);
        if (logger.isWarnEnabled()) {
            logger.warn("SSLContextInitializer is being overridden");
        }// ww w .  j a  v  a  2 s .  c o  m
    }
    staticContextInitializer = initializer;
}

From source file:com.sinosoft.one.mvc.controllers.MvcToolsInterceptor.java

@Override
public Object before(Invocation inv) throws Exception {
    Class<?> controllerClass = inv.getControllerClass();
    if (!LogFactory.getLog(controllerClass).isDebugEnabled()) {
        String msg = String.format("warning: set logger.%s to debug level first. " + "<br> Mvc-Version: %s",
                controllerClass.getName(), MvcVersion.getVersion());
        return Utils.wrap(msg);
    }//from  w  w  w. j  a  v a 2  s .c o  m
    return true;
}

From source file:com.cyberway.core.quartz.objects.example.PlugInExample.java

public void run() throws Exception {
    Log log = LogFactory.getLog(PlugInExample.class);

    // First we must get a reference to a scheduler
    SchedulerFactory sf = new StdSchedulerFactory();
    Scheduler sched = sf.getScheduler();

    log.info("------- Initialization Complete -----------");

    log.info("------- (Not Scheduling any Jobs - relying on XML definitions --");

    log.info("------- Starting Scheduler ----------------");

    // start the schedule 
    sched.start();/*from   w ww  . ja v  a  2s. c  o  m*/

    log.info("------- Started Scheduler -----------------");

    log.info("------- Waiting five minutes... -----------");

    // wait five minutes to give our jobs a chance to run
    try {
        Thread.sleep(50L * 1000L);
    } catch (Exception e) {
    }

    // shut down the scheduler
    log.info("------- Shutting Down ---------------------");
    sched.shutdown(true);
    log.info("------- Shutdown Complete -----------------");

    SchedulerMetaData metaData = sched.getMetaData();
    log.info("Executed " + metaData.getNumberOfJobsExecuted() + " jobs.");
}

From source file:com.javaexchange.RandomGUIDTest.java

/**
 * Create the test case/* w  w w .  java  2s .  c o m*/
 * 
 * @param testName
 *            name of the test case
 */
public RandomGUIDTest(String testName) {
    super(testName);

    logger = LogFactory.getLog(this.getClass());
    logger.debug("RandomGUIDTest");
}

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

public static TemplatingEngine getTemplatingEngine(Config.Templating oTemplatingConfig, ModelPool oModelPool,
        ClassLoader oClassLoader, ServletConfig oServletConfig)
        throws ClassNotFoundException, IOException, InvocationTargetException, ConstructorNotFoundException,
        ParameterProviderException, IllegalAccessException, InstantiationException {
    TemplatingEngine oTemplatingEngine;/*from w w  w  . j  av  a 2s. co m*/
    String sTemplatingEngineClassName;
    Log oLog;

    oLog = LogFactory.getLog(TemplatingEngineInitializer.class);

    sTemplatingEngineClassName = oTemplatingConfig.getTemplatingEngine().getClassName();

    if (Strings.isEmpty(sTemplatingEngineClassName)) {
        // if no templating engine is configured use the freemarker engine as the default
        oTemplatingEngine = new FreemarkerTemplatingEngine(oTemplatingConfig, oClassLoader, oServletConfig);
    } else {
        oLog.info("loading user-defined templating engine: " + sTemplatingEngineClassName);

        Class oTemplatingEngineClass = oClassLoader
                .loadClass(oTemplatingConfig.getTemplatingEngine().getClassName());

        oTemplatingEngine = (TemplatingEngine) ObjectFactory.createObject(oTemplatingEngineClass,
                new Object[] { oServletConfig, oTemplatingConfig, oClassLoader },
                new InitializerParameterProvider(oModelPool, "templating-engine-init"));
    }

    return oTemplatingEngine;
}

From source file:gridool.monitor.GridMonitorFactory.java

private static void setupAdditionalListeners(@Nonnull GridExecutionMonitor monitor,
        @Nonnull String additional) {
    final String[] listeners = additional.split(",");
    for (String listenerClazz : listeners) {
        Object obj = ObjectUtils.instantiateSafely(listenerClazz.trim());
        if (obj != null && obj instanceof GridExecutionListener) {
            GridExecutionListener listener = (GridExecutionListener) obj;
            monitor.addListener(listener);
        } else {/*  w w  w .j a v a2  s . c o  m*/
            LogFactory.getLog(GridMonitorFactory.class)
                    .warn("Specified GridExecutionListener not found: " + listenerClazz);
        }
    }
}

From source file:net.paoding.rose.controllers.RoseToolsInterceptor.java

@Override
public Object before(Invocation inv) throws Exception {
    Class<?> controllerClass = inv.getControllerClass();
    if (!LogFactory.getLog(controllerClass).isDebugEnabled()) {
        String msg = String.format("warning: set logger.%s to debug level first. " + "<br> Rose-Version: %s",
                controllerClass.getName(), RoseVersion.getVersion());
        return Utils.wrap(msg);
    }//  w  w w  .  j  ava  2 s.co  m
    return true;
}

From source file:com.adaptris.security.password.PasswordTest.java

@Before
public void setUp() throws Exception {
    logR = LogFactory.getLog(this.getClass());
}

From source file:com.amazonaws.client.metrics.support.SdkMBeanRegistrySupport.java

@Override
public boolean registerMetricAdminMBean(String objectName) {
    try {/*  ww w . j a v a 2  s . c  om*/
        return MBeans.registerMBean(objectName, new MetricAdmin());
    } catch (Exception ex) {
        LogFactory.getLog(SdkMBeanRegistrySupport.class).warn("", ex);
    }
    return false;
}

From source file:fr.aliasource.webmail.server.SecureAjaxCall.java

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