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.dynamobi.pentaho.whlabel.WHLabelContentGenerator.java

@Override
public Log getLogger() {
    return LogFactory.getLog(WHLabelContentGenerator.class);
}

From source file:dk.statsbiblioteket.util.i18n.BundleCache.java

private BundleCache() {
    cache = new HashMap<String, ResourceBundle>();
    log = LogFactory.getLog(BundleCache.class);
}

From source file:com.glweb.util.GlobalProperties.java

private GlobalProperties() {
    _logger = LogFactory.getLog("com.glweb.util.GlobalProperties");

    try {//w ww .jav a2  s . c o m
        InputStream _in = ClassLoader.getSystemResourceAsStream(CONFIG);

        if (null == _in) {
            _logger.warn("<Unable to find the global properties from system resources/>");
            _logger.warn("<Try to find the global properties from class resources/>");

            _in = getClass().getResourceAsStream(CONFIG);

            if (null == _in) {
                _logger.warn("<Unable to find the global properties from class resources/>");
            } else {
                _logger.info("<Found the global properties from class resources/>");
            }
        } else {
            _logger.info("<Found the global properties from system resources/>");
        }

        getGlobalProperties().load(_in);
    } catch (IOException ioe) {
        _logger.error("<Unable to read global properties!/>");
    }
}

From source file:com.miraclelinux.historygluon.RiakDriver.java

public RiakDriver(String[] args) {
    super(args);
    m_log = LogFactory.getLog(RiakDriver.class);
    setStopKeyMinus1(true);
}

From source file:de.berlios.jedi.data.admin.HibernateAdminDataManager.java

/**
 * Saves a JispPackage.<br>/*  w w w  .  j  a  v  a  2  s . c o m*/
 * If the JispPackage was already stored, it will be updated. The
 * JispPackage is identified by its name and version (stored in its
 * JispMetadata object).
 * 
 * @param jispPackage
 *            The JispPackage to save.
 * @throws DataException
 *             If there was a problem when saving a JispPackage.
 */
public void saveJispPackage(JispPackage jispPackage) throws DataException {
    try {
        Session session = HibernateUtil.currentSession();
        Transaction tx = session.beginTransaction();

        session.saveOrUpdate(jispPackage);

        tx.commit();
    } catch (HibernateException e) {
        LogFactory.getLog(HibernateDataManager.class)
                .error("Hibernate threw an exception when" + " saving a JispPackage", e);
        throw new DataException("A problem occured when saving a JispPackage", e);
    } finally {
        HibernateUtil.closeSession();
    }
}

From source file:com.serotonin.m2m2.web.dwr.DataPointDwr.java

/**
 * Default Constructor/* w ww . j a va 2s. c  om*/
 */
public DataPointDwr() {
    super(DataPointDao.instance, "dataPoints");
    LOG = LogFactory.getLog(DataPointDwr.class);
}

From source file:gridool.discovery.DiscoveryServiceProvider.java

private static void setupAdditionalListeners(@Nonnull GridDiscoveryService srv, @Nonnull String additional) {
    final String[] listeners = additional.split(",");
    for (String listenerClazz : listeners) {
        Object obj = ObjectUtils.instantiateSafely(listenerClazz.trim());
        if (obj != null && obj instanceof GridDiscoveryListener) {
            GridDiscoveryListener listener = (GridDiscoveryListener) obj;
            srv.addListener(listener);//from  ww  w.  j  a v  a2s  .co  m
        } else {
            LogFactory.getLog(DiscoveryServiceProvider.class)
                    .warn("Specified DiscoveryListener not found: " + listenerClazz);
        }
    }
}

From source file:jp.co.acroquest.endosnipe.common.logger.Log4jENdoSnipeLogger.java

/**
 * Log???<br />//from www  . j av a2 s. c o m
 * 
 * @param clazz Class
 */
protected Log4jENdoSnipeLogger(final Class<?> clazz) {
    if (clazz == null) {
        throw new IllegalArgumentException("clazz can't be null.");
    }
    log_ = LogFactory.getLog(clazz);
}

From source file:com.alfaariss.oa.engine.user.provisioning.translator.standard.converter.ConverterManager.java

/**
  * Creates the object./*from ww w .  j a va  2s . c o m*/
 * @param oConfigurationManager the configuration manager
 * @param eConfig the configuration section with configuration of this object
 * @throws UserException if converting fails
 */
public ConverterManager(IConfigurationManager oConfigurationManager, Element eConfig) throws UserException {
    _htConverters = new Hashtable<String, IConverter>();
    try {
        _logger = LogFactory.getLog(ConverterManager.class);

        Element eConverter = oConfigurationManager.getSection(eConfig, "converter");
        if (eConverter == null) {
            _logger.error("No 'converter' section found in configuration");
            throw new UserException(SystemErrors.ERROR_CONFIG_READ);
        }

        while (eConverter != null) {
            String sConverterID = oConfigurationManager.getParam(eConverter, "id");
            if (sConverterID == null) {
                _logger.error("No 'id' parameter found in 'converter' section");
                throw new UserException(SystemErrors.ERROR_CONFIG_READ);
            }

            if (_htConverters.containsKey(sConverterID)) {
                StringBuffer sbError = new StringBuffer("The converter with id '");
                sbError.append(sConverterID);
                sbError.append("' is not unique");

                _logger.error(sbError.toString());

                throw new UserException(SystemErrors.ERROR_INIT);
            }

            String sConverterClass = oConfigurationManager.getParam(eConverter, "class");
            if (sConverterClass == null) {
                _logger.error("No 'class' parameter found in 'converter' section with id: " + sConverterID);
                throw new UserException(SystemErrors.ERROR_CONFIG_READ);
            }

            if (sConverterClass.startsWith("."))
                sConverterClass = PACKAGENAME + sConverterClass;

            Class oConverterClass = null;
            try {
                oConverterClass = Class.forName(sConverterClass);
            } catch (Exception e) {
                _logger.error("No 'class' found with name: " + sConverterClass, e);
                throw new UserException(SystemErrors.ERROR_INIT);
            }

            IConverter oConverter = null;
            try {
                oConverter = (IConverter) oConverterClass.newInstance();
            } catch (Exception e) {
                _logger.error(
                        "Could not create an 'IConverter' instance of the configured 'class' found with name: "
                                + sConverterClass,
                        e);
                throw new UserException(SystemErrors.ERROR_INIT);
            }

            oConverter.start(oConfigurationManager, eConverter);

            _htConverters.put(sConverterID, oConverter);

            eConverter = oConfigurationManager.getNextSection(eConverter);
        }
    } catch (UserException e) {
        throw e;
    } catch (Exception e) {
        _logger.fatal("Could not initialize object", e);
        throw new UserException(SystemErrors.ERROR_INTERNAL);
    }
}

From source file:com.runwaysdk.business.generation.EclipseCompiler.java

/**
 * Calls the ECJ and wraps any errors in a {@link CompilerException}
 * /*from   w w w.j a  v  a  2  s . c om*/
 * @param args Arguments for the compiler
 * @throws CompilerException if compilation fails
 */
private void callECJ(String args[]) {
    Log log = LogFactory.getLog(COMPILER_LOG);
    log.trace(Arrays.deepToString(args));

    StringWriter output = new StringWriter();
    StringWriter errors = new StringWriter();
    Main compiler = new Main(new PrintWriter(output), new PrintWriter(errors), false);

    compiler.compile(args);

    String message = errors.toString();

    if (message.length() > 0) {
        String error = "Errors found during compilation:\n" + message;
        throw new CompilerException(error, message);
    }
}