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:com.blockwithme.hacktors.Main.java

/** {@inheritDoc} */
@Override//www. j  ava 2  s.c om
public void start(final BundleContext context) throws Exception {
    start();
    LogFactory.getLog(Main.class).info(" **************start(final BundleContext context)****************");
}

From source file:fr.aliasource.webmail.common.cache.CacheManager.java

public CacheManager(AccountCache cache, IAccount account) {
    this.logger = LogFactory.getLog(getClass());
    this.account = account;
    this.cache = cache;
    this.skipCount = 0;
    this.uidc = new HashMap<IFolder, UIDCache>();
    firstIndexingRoundLock = new Semaphore(1);
    refreshLock = new Semaphore(1);
    grabFirstLock();/*ww w  .j  a  v a  2s. c  o m*/
}

From source file:com.alfaariss.oa.engine.storage.jdbc.JDBCFactory.java

/**
 * Constructor creates the object.
 */
public JDBCFactory() {
    _logger = LogFactory.getLog(JDBCFactory.class);
    _bEnabled = false;
    _dsModel = null;
    _dsSystem = null;
}

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

@Test
public void testLogFatalMessageWithException() {
    String msg = "testLogFatalMessageWithException";
    Log logger = LogFactory.getLog(getClass());
    Throwable t = new IllegalArgumentException(msg);
    logger.fatal(msg, t);//w w  w . ja v a  2  s.  c  om
    assertLoggingOperation(Log.class, "FATAL", msg, t);
}

From source file:net.jperf.commonslog.CommonsLogStopWatchTest.java

public void testStopWatch() throws Exception {
    //We override the testStopWatch method because the way we configure the LogFactory doesn't work in 
    //TeamCity, so we skip this test in TeamCity builds.
    LogFactory.getLog(StopWatch.DEFAULT_LOGGER_NAME).info("GOING_TO_STD_ERR");
    if (fakeErr.toString().indexOf("GOING_TO_STD_ERR") >= 0) {
        //then things are set up correctly, run the test
        super.testStopWatch();
    } else {// w  w w  . j  a va2  s . c  o m
        System.out.println("Logging isn't going to our std err as expected - skipping CommonsLogStopWatchTest");
    }
}

From source file:com.predic8.membrane.core.interceptor.oauth2.authorizationservice.AuthorizationService.java

public void init(Router router) throws Exception {
    log = LogFactory.getLog(this.getClass().getName());

    setHttpClient(getHttpClientConfiguration() == null
            ? router.getResolverMap().getHTTPSchemaResolver().getHttpClient()
            : new HttpClient(getHttpClientConfiguration()));
    if (sslParser != null)
        sslContext = new SSLContext(sslParser, router.getResolverMap(), router.getBaseLocation());
    this.router = router;
    init();//  ww  w .ja v a  2s. com
    if (!supportsDynamicRegistration())
        checkForClientIdAndSecret();
}

From source file:com.ah.util.Tracer.java

public Tracer(String srcClass) {
    this.srcClass = srcClass;
    this.logger = LogFactory.getLog("tracerlog");
}

From source file:com.alfaariss.oa.profile.aselect.binding.protocol.cgi.CGIRequest.java

/**
 * Creates the CGI request object./* w w w.  ja v a  2s.  c  om*/
 * 
 * Reads the request parameters and puts them in a <code>Hashtable</code>
 * @param oRequest the servlet request 
 * @throws BindingException if the request object can't be created
 */
public CGIRequest(HttpServletRequest oRequest) throws BindingException {
    try {
        _logger = LogFactory.getLog(CGIRequest.class);
        _htRequest = new Hashtable<String, Object>();
        _sRequestedURL = oRequest.getRequestURL().toString();

        if (_logger.isDebugEnabled()) {
            String sQueryString = oRequest.getQueryString();
            if (sQueryString == null)
                sQueryString = "";
            _logger.debug("QueryString: " + sQueryString);
        }

        Hashtable<String, Vector<String>> htVectorItems = new Hashtable<String, Vector<String>>();
        Enumeration enumNames = oRequest.getParameterNames();
        while (enumNames.hasMoreElements()) {
            String sName = (String) enumNames.nextElement();
            String sValue = oRequest.getParameter(sName);
            if (sName.endsWith(CGIBinding.ENCODED_BRACES)
                    || sName.endsWith(CGIBinding.ENCODED_BRACES.toLowerCase()) || sName.endsWith("[]")) {
                Vector<String> vValues = htVectorItems.get(sName);
                if (vValues == null)
                    vValues = new Vector<String>();
                vValues.add(sValue);
                htVectorItems.put(sName, vValues);
            } else
                _htRequest.put(sName, sValue);
        }

        _htRequest.putAll(htVectorItems);
    } catch (Exception e) {
        _logger.fatal("Internal error during CGI Request creation", e);
        throw new BindingException(SystemErrors.ERROR_INTERNAL);
    }
}

From source file:fr.aliasource.webmail.common.cache.FileCache.java

protected FileCache(IAccount account, String category, String cacheName, IDirectCommand<W> command) {
    super(account);
    this.command = command;
    updateLock = new Semaphore(1);
    this.category = category;
    this.cacheName = cacheName;
    this.cDirectory = account.getCache().getCachePath() + File.separator + category;
    new File(cDirectory).mkdirs();
    this.cFile = new File(cDirectory + File.separator + cacheName + ".xml");
    this.logger = LogFactory.getLog(getClass());

    if (!exists()) {
        initEmpty();/*from   www. j  a  va2 s . c  om*/
    }
}

From source file:jp.ac.u.tokyo.m.resource.ResourceLoadUtil.java

/**
 * This method read Ini in the same package. <br>
 * If the file does not exist, logging WARN. <br>
 * <br>/*from   w w w .  j a va 2 s .c  om*/
 * aFileName ????? Ini ???? <br>
 * ???????? <br>
 */
public static Ini loadUnnecessaryPackagePrivateIni(Class<?> aClass, String aFileName) {
    try {
        return loadIni(aClass, aFileName, aClass.getResourceAsStream(aFileName));
    } catch (NullPointerException e) {
        LogFactory.getLog(aClass).warn("not found : " + aClass.getPackage() + "." + aFileName);
        return new Ini();
    }
}