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.book.ContactGroupsAction.java

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

From source file:com.rackspace.external.pjlcompression.JakartaCommonsLoggingImpl.java

/**
 * This constructor is public so that it may be instantiated by reflection.
 *
 * @param loggerName Jakarta Log name/* w ww.  ja v a 2  s  .  c  o m*/
 */
public JakartaCommonsLoggingImpl(String loggerName) {
    logger = LogFactory.getLog(loggerName);
}

From source file:jlg.jade.example.DatagramConvertor.java

DatagramConvertor(BlockingQueue<byte[]> rawQueue, String[] args) {
    this.rawQueue = rawQueue;
    this.logger = LogFactory.getLog("jlg.jade");
    this.isLogEnabled = Boolean.parseBoolean(args[1]);
    this.allowedCategories = args[3];
}

From source file:com.agiletec.apsadmin.tags.util.ParamMap.java

@Override
public boolean end(Writer writer, String body) {
    Log log = LogFactory.getLog(ParamMap.class);
    Component component = this.findAncestor(Component.class);
    if (null == this.getMap()) {
        log.info("Attribute map is mandatory.");
        return super.end(writer, body);
    }/*from   ww  w.  j a  va2 s. co m*/
    Object object = this.findValue(this.getMap());
    if (null == object) {
        log.debug("Map not found in ValueStack");
        return super.end(writer, body);
    }
    if (!(object instanceof Map)) {
        log.warn("Error in JSP. Attribute map must evaluate to java.util.Map. Found type: "
                + object.getClass().getName());
        return super.end(writer, body);
    }
    component.addAllParameters((Map) object);
    return super.end(writer, body);
}

From source file:het.springapp.model.User.java

public User(String[] values) {
    Log log = LogFactory.getLog(User.class);
    setUserId(values[0]);/*from  w w  w. j  av  a2s  . c o m*/
    setPassword(values[1]);
    log.info("converting json object to user for userId " + values[0]);
}

From source file:arena.utils.URLUtils.java

public static String addParamToURL(String baseURL, String paramName, String paramValue, String encoding,
        boolean replace) {
    StringBuffer out = new StringBuffer();
    Log log = LogFactory.getLog(URLUtils.class);

    String useEncoding = ((encoding == null) ? "ISO-8859-1" : encoding);

    if ((paramName != null) && (paramValue != null)) {
        log.debug("URL encoding param: " + paramName + "=" + paramValue + " (ignored if null)");

        String encodedParamName = encodeURLToken(paramName, useEncoding);
        String encodedParamValue = encodeURLToken(paramValue, useEncoding);

        out.append(encodedParamName).append("=").append(encodedParamValue).append("&");

        // Remove if replacing
        int paramExistsLoc = baseURL.indexOf(encodedParamName + "=");

        if (replace && (paramExistsLoc != -1)) {
            log.debug(//from  w w  w . j av  a2  s.c  om
                    "Replacing parameter: " + paramName + " in URL: " + baseURL + " with value " + paramValue);
            int prevAmpersandPos = baseURL.substring(0, paramExistsLoc).lastIndexOf("&");
            int nextAmpersandPos = baseURL.indexOf("&", paramExistsLoc);

            if (nextAmpersandPos != -1) {
                baseURL = baseURL.substring(0, paramExistsLoc) + baseURL.substring(nextAmpersandPos + 1);
            } else {
                baseURL = baseURL.substring(0, (prevAmpersandPos == -1) ? paramExistsLoc : prevAmpersandPos);
            }
        }
    }

    if (out.length() == 0) {
        return baseURL;
    } else if (baseURL.endsWith("?")) {
        return baseURL + out.substring(0, out.length() - 1);
    } else if (baseURL.indexOf("?") == -1) {
        return baseURL + "?" + out.substring(0, out.length() - 1);
    } else {
        return baseURL + "&" + out.substring(0, out.length() - 1);
    }
}

From source file:net.sf.oval.logging.LoggerJCLImpl.java

/**
 * @param name the name of the logger//from   w  w  w.  j  a  va2  s  .com
 * @throws IllegalArgumentException if <code>name == null</code>
 */
public LoggerJCLImpl(final String name) throws IllegalArgumentException {
    Assert.argumentNotNull("name", name);

    jclLoggger = LogFactory.getLog(name);
}

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

public static ControllerResolver getControllerResolver(Config.ControllerResolver oControllerResolverConfig,
        Config.ControllerMapping oControllerMappingConfig, ModelPool oModelPool, ClassLoader oClassLoader,
        ServletConfig oServletConfig)//from   w ww  .j  ava  2  s.com
        throws ClassNotFoundException, InvocationTargetException, ConstructorNotFoundException,
        ParameterProviderException, IllegalAccessException, InstantiationException, IOException {
    ControllerResolver oControllerResolver;
    String sControllerResolverClassName;
    Log oLog;

    oLog = LogFactory.getLog(ControllerResolverInitializer.class);

    sControllerResolverClassName = oControllerResolverConfig.getClassName();

    if (Strings.isEmpty(sControllerResolverClassName)) {
        oControllerResolver = new ShortURLControllerResolver(oControllerMappingConfig, oClassLoader);
    } else {
        oLog.info("loading user-defined controller resolver: " + sControllerResolverClassName);

        Class oControllerResolverClass = oClassLoader.loadClass(sControllerResolverClassName);

        // attempt to find and call the single public constructor
        oControllerResolver = (ControllerResolver) ObjectFactory.createObject(oControllerResolverClass,
                new Object[] { oServletConfig, oControllerResolverConfig, oControllerMappingConfig,
                        oClassLoader },
                new InitializerParameterProvider(oModelPool, "controller-resolver-init"));
    }

    return oControllerResolver;
}

From source file:eu.planets_project.tb.impl.persistency.TestbedServiceTemplatePersistencyImpl.java

/**
 * A Factory method to build a reference to this interface.
 * @return/*from  ww  w. j a v a2  s . c  om*/
 */
public static TestbedServiceTemplatePersistencyRemote getInstance() {
    Log log = LogFactory.getLog(TestbedServiceTemplatePersistencyImpl.class);
    try {
        Context jndiContext = new javax.naming.InitialContext();
        TestbedServiceTemplatePersistencyRemote dao_r = (TestbedServiceTemplatePersistencyRemote) PortableRemoteObject
                .narrow(jndiContext.lookup("testbed/TestbedServiceTemplatePersistencyImpl/remote"),
                        TestbedServiceTemplatePersistencyRemote.class);
        return dao_r;
    } catch (NamingException e) {
        log.error("Failure in getting PortableRemoteObject: " + e.toString());
        return null;
    }
}

From source file:fr.aliasource.webmail.quota.ActionGetQuotaAction.java

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