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:de.berlios.jedi.data.HibernateUtil.java

/**
 * Closes the active session.<br>/*from  w w w . j av  a  2 s  . c o  m*/
 * If there was no active session for this Thread, nothing is done.
 */
public static void closeSession() {
    Session s = (Session) session.get();
    if (s != null) {
        try {
            s.close();
        } catch (HibernateException e) {
            LogFactory.getLog(HibernateUtil.class).error("An error occured when closing the Hibernate session",
                    e);
        }
    }
    session.set(null);
}

From source file:es.tunelator.log.Logger.java

/**
 * @param source//  ww w .  j av a 2s  . co m
 * @param e
 */
public static void logFatal(Class source, Throwable e) {
    Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_FATAL);
    //        Log log = LogFactory.getLog(source);
    log.error(getStringStackTrace(e));
}

From source file:com.alfaariss.oa.util.web.ResponseHeader.java

/**
 * Constructor./*from  www .j a v  a  2  s  .com*/
 * @param configurationManager The configuration manager.
 * @param config The header configuration.
 * @throws OAException if configuration is invalid. 
 */
public ResponseHeader(IConfigurationManager configurationManager, Element config) throws OAException {
    _logger = LogFactory.getLog(ResponseHeader.class);
    try {
        _sName = configurationManager.getParam(config, "name");
        if (_sName == null) {
            _logger.error("No 'name' item found in 'header' section in configuration");
            throw new OAException(SystemErrors.ERROR_INTERNAL);
        }

        _sValue = configurationManager.getParam(config, "value");
        if (_sValue == null) {
            _logger.error("No 'value' item found in 'header' section in configuration");
            throw new OAException(SystemErrors.ERROR_INTERNAL);
        }
    } catch (OAException e) {
        throw e;
    } catch (Exception e) {
        _logger.fatal("Internal error during creation", e);
        throw new OAException(SystemErrors.ERROR_INTERNAL);
    }
}

From source file:com.microsoft.tfs.client.common.ui.framework.console.Console.java

public Console(final String name, final String loggingId, final ImageDescriptor imageDescriptor) {
    messageConsole = new TFSMessageConsole(name, imageDescriptor);

    String logName = Console.class.getName();
    if (loggingId != null) {
        logName = logName + "." + loggingId; //$NON-NLS-1$
    }/*from   ww  w.j  a va  2  s.  c  o  m*/
    log = LogFactory.getLog(logName);

    addStream(DEFAULT_STREAM_ID);

    /*
     * can be called from any thread
     */
    ConsoleManager.getDefault().addConsole(this);
}

From source file:com.github.cmisbox.local.Watcher.java

private Watcher() {
    this.log = LogFactory.getLog(this.getClass());

    this.thread = new Thread(this, "Watcher");
    this.thread.start();
}

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

@Override
public long[] getFileDecriptorInfo() {
    MBeanServer mbsc = MBeans.getMBeanServer();
    AttributeList attributes;//w ww  .ja  v a  2  s . com
    try {
        attributes = mbsc.getAttributes(new ObjectName("java.lang:type=OperatingSystem"),
                new String[] { "OpenFileDescriptorCount", "MaxFileDescriptorCount" });
        List<Attribute> attrList = attributes.asList();
        long openFdCount = (Long) attrList.get(0).getValue();
        long maxFdCount = (Long) attrList.get(1).getValue();
        long[] fdCounts = { openFdCount, maxFdCount };
        return fdCounts;
    } catch (Exception e) {
        LogFactory.getLog(SdkMBeanRegistrySupport.class).debug("Failed to retrieve file descriptor info", e);
    }
    return null;
}

From source file:com.markuspage.jbinrepoproxy.standalone.trust.s4u.PGPVerifyMavenPluginKeysMap.java

public PGPVerifyMavenPluginKeysMap(File cacheKeysFolder, String cacheKeysServer) throws URISyntaxException,
        CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException, KeyManagementException {
    this.delegate = new PGPKeysCache(LogFactory.getLog(PGPVerifyMavenPluginKeysMap.class), cacheKeysFolder,
            cacheKeysServer);// w  w  w . ja  v  a2 s .  c  o m
}

From source file:com.alfaariss.oa.authentication.password.jdbc.JDBCPasswordHandler.java

/**
 * Default constructor of <code>JDBCPasswordHandler</code>.
 */
public JDBCPasswordHandler() {
    _logger = LogFactory.getLog(JDBCPasswordHandler.class);
}

From source file:com.alfaariss.oa.engine.user.provisioning.storage.StorageManager.java

/**
 * Creates the object./* www  .  j a v  a 2s.c  o m*/
 */
public StorageManager() {
    _logger = LogFactory.getLog(StorageManager.class);
    _htStorages = new Hashtable<String, IStorage>();
}

From source file:com.haulmont.cuba.core.sys.jmx.MBeanExporter.java

public MBeanExporter() {
    setAssembler(new AnnotationMBeanInfoAssembler());
    // hack logging
    try {/*from   w w w  . j a v  a  2 s. c  o m*/
        Field loggerField = MBeanRegistrationSupport.class.getDeclaredField("logger");
        loggerField.setAccessible(true);
        loggerField.set(this, LogFactory.getLog(org.springframework.jmx.export.MBeanExporter.class));
    } catch (NoSuchFieldException | IllegalAccessException ignore) {
    }
}