List of usage examples for org.apache.commons.logging Log info
void info(Object message);
From source file:com.ery.ertc.estorm.util.ToolUtil.java
public static synchronized Process runProcess(String command, Log log) throws IOException { log.info("" + command); // Process proc = Runtime.getRuntime().exec(new String[] { command }); Process proc = Runtime.getRuntime().exec(command); return proc;/*from ww w. j a v a 2 s . co m*/ }
From source file:es.tunelator.log.Logger.java
/** * @param source// w ww .j av a 2 s . c o m * @param e */ public static void logInfo(Class source, Exception e) { Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_INFO); // Log log = LogFactory.getLog(source); log.info(e.getMessage()); }
From source file:es.tunelator.log.Logger.java
/** * @param source/*from w w w. j a v a 2 s.c om*/ * @param msg */ public static void logInfo(Class source, String msg) { Log log = LogFactory.getLog(es.tunelator.AppParameters.LOG_INFO); // Log log = LogFactory.getLog(source); log.info(msg); }
From source file:eu.stratosphere.yarn.Utils.java
public static void logFilesInCurrentDirectory(final Log logger) { new File(".").list(new FilenameFilter() { @Override/*from w ww . ja v a 2 s . c om*/ public boolean accept(File dir, String name) { logger.info(dir.getAbsolutePath() + "/" + name); return true; } }); }
From source file:com.alibaba.wasp.util.ResultInHBasePrinter.java
public static void printTablesRs(String type, Configuration conf, String tablename, String indexName, Log LOG) throws IOException { StorageActionManager manager = new StorageActionManager(conf); String indexTableName = FConstants.WASP_TABLE_INDEX_PREFIX + tablename + FConstants.TABLE_ROW_SEP + indexName;/*w w w . j a va2 s. com*/ try { LOG.info("rs begin " + type); // manager.scan(".META.", new Scan()); // manager.scan(StorageTableNameBuilder.buildEntityTableName("TEST_TABLE"), // new Scan()); // ResultScanner fmeters = manager.scan("_FMETA_", new Scan()); ResultScanner indexrs = manager.scan(indexTableName, new Scan()); ResultScanner rs = manager.scan(FConstants.WASP_TABLE_ENTITY_PREFIX + tablename, new Scan()); // LOG.info("rs fmeta"); // print(fmeters); LOG.info("rs table " + type); print(rs, LOG); LOG.info("rs index, table name = " + indexTableName); // WASP_INDEX_TEST_TABLE_test_index print(indexrs, LOG); LOG.info("rs end"); } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } // TEST!!! }
From source file:com.acciente.induction.init.ViewResolverInitializer.java
public static ViewResolver getViewResolver(Config.ViewResolver oViewResolverConfig, Config.ViewMapping oViewMappingConfig, ModelPool oModelPool, ClassLoader oClassLoader, ServletConfig oServletConfig)//from w w w . jav a 2s . c om throws ClassNotFoundException, InvocationTargetException, ConstructorNotFoundException, ParameterProviderException, IllegalAccessException, InstantiationException, IOException { ViewResolver oViewResolver; String sViewResolverClassName; Log oLog; oLog = LogFactory.getLog(ViewResolverInitializer.class); sViewResolverClassName = oViewResolverConfig.getClassName(); if (Strings.isEmpty(sViewResolverClassName)) { oViewResolver = new ShortURLViewResolver(oViewMappingConfig, oClassLoader); } else { oLog.info("loading user-defined view resolver: " + sViewResolverClassName); Class oViewResolverClass = oClassLoader.loadClass(sViewResolverClassName); // attempt to find and call the single public constructor oViewResolver = (ViewResolver) ObjectFactory.createObject(oViewResolverClass, new Object[] { oServletConfig, oViewResolverConfig, oViewMappingConfig, oClassLoader }, new InitializerParameterProvider(oModelPool, "view-resolver-init")); } return oViewResolver; }
From source file:gridool.GridConfiguration.java
@Nonnull private static HashFunction createHashFunction() { String clazz = Settings.get("gridool.hash.hasher"); if (clazz == null) { String algoName = Settings.get("gridool.hash.algorithm", "sha-1"); HashAlgorithm algo = HashAlgorithm.resolve(algoName); Log LOG = LogFactory.getLog(GridConfiguration.class); if (LOG.isInfoEnabled()) { LOG.info("gridool.hash.algorithm = " + algo); }//from w w w .j av a 2 s. c o m return new DefaultHashFunction(algo); } Object instance = ObjectUtils.instantiate(clazz); if (!(instance instanceof HashFunction)) { throw new IllegalStateException("Hash function must be subclass of " + HashFunction.class.getName() + ", but was " + (instance == null ? "null" : instance.getClass().getName())); } return (HashFunction) instance; }
From source file:com.brienwheeler.lib.spring.beans.AutowireUtils.java
public static <T> Collection<T> getAutowireBeans(ApplicationContext applicationContext, Class<T> clazz, Log log) { ValidationUtils.assertNotNull(applicationContext, "applicationContext cannot be null"); ValidationUtils.assertNotNull(clazz, "clazz cannot be null"); ValidationUtils.assertNotNull(log, "log cannot be null"); Map<String, T> beans = applicationContext.getBeansOfType(clazz); if (beans.size() > 0) { log.info("autowiring " + beans.size() + " " + clazz.getSimpleName()); }/*from w w w .j a v a 2s. c o m*/ return beans.values(); }
From source file:com.acciente.induction.init.RedirectResolverInitializer.java
public static RedirectResolver getRedirectResolver(Config.RedirectResolver oRedirectResolverConfig, Config.RedirectMapping oRedirectMappingConfig, ModelPool oModelPool, ClassLoader oClassLoader, ServletConfig oServletConfig)// www .j a v a 2 s .co m throws ClassNotFoundException, InvocationTargetException, ConstructorNotFoundException, ParameterProviderException, IllegalAccessException, InstantiationException, IOException { RedirectResolver oRedirectResolver; String sRedirectResolverClassName; Log oLog; oLog = LogFactory.getLog(RedirectResolverInitializer.class); sRedirectResolverClassName = oRedirectResolverConfig.getClassName(); if (Strings.isEmpty(sRedirectResolverClassName)) { oRedirectResolver = new ShortURLRedirectResolver(oRedirectMappingConfig, oClassLoader); } else { oLog.info("loading user-defined redirect resolver: " + sRedirectResolverClassName); Class oRedirectResolverClass = oClassLoader.loadClass(sRedirectResolverClassName); // attempt to find and call the single public constructor oRedirectResolver = (RedirectResolver) ObjectFactory.createObject(oRedirectResolverClass, new Object[] { oServletConfig, oRedirectResolverConfig, oRedirectMappingConfig, oClassLoader }, new InitializerParameterProvider(oModelPool, "redirect-resolver-init")); } return oRedirectResolver; }
From source file:edu.indiana.lib.twinpeaks.util.LogUtils.java
/** * Serialize an XML object (Document or Element) to the log (with an * optional warning header)//from w w w. j ava2s . c o m * @param log Apache Log object * @param errorText Error message (null for none) * @param recordElement The XML object to disolay (Document, Element) */ public static void displayXml(org.apache.commons.logging.Log log, String errorText, Object xmlObject) { if (!(xmlObject instanceof Document) && !(xmlObject instanceof Element)) { throw new IllegalArgumentException("Unexpected object for serialzation: " + xmlObject.toString()); } if (!StringUtils.isNull(errorText)) { log.error(errorText); } log.info("Record Start ----------------------------------------"); try { log.info(DomUtils.serialize(xmlObject)); } catch (DomException exception) { log.error("Failed to serialize element " + xmlObject.toString(), exception); } log.info("Record End ------------------------------------------"); }