List of usage examples for org.apache.commons.logging Log info
void info(Object message);
From source file:com.aliyun.odps.utils.StringUtils.java
/** * Print a log message for starting up and shutting down * * @param clazz/*from w ww . ja va 2s . c o m*/ * the class of the server * @param args * arguments * @param LOG * the target log object */ public static void startupShutdownMessage(Class<?> clazz, String[] args, final org.apache.commons.logging.Log LOG) { final String hostname = getHostname(); final String classname = clazz.getSimpleName(); LOG.info(toStartupShutdownString("STARTUP_MSG: ", new String[] { "Starting " + classname, " host = " + hostname, " args = " + Arrays.asList(args) })); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { LOG.info(toStartupShutdownString("SHUTDOWN_MSG: ", new String[] { "Shutting down " + classname + " at " + hostname })); } }); }
From source file:com.winvector.logistic.demo.MapReduceScore.java
@Override public int run(final String[] args) throws Exception { if (args.length != 3) { final Log log = LogFactory.getLog(MapReduceScore.class); log.info(Licenses.licenses); log.fatal("use: MapReduceScore model.ser testFile resultDir"); return -1; }//from w ww . ja v a 2 s . co m final String modelFileName = args[0]; final String testFileName = args[1]; final String resultFileName = args[2]; run(modelFileName, testFileName, resultFileName); return 0; }
From source file:com.tanist.quartz.SimpleExample.java
public void run() throws Exception { Log log = LogFactory.getLog(SimpleExample.class); log.info("------- Initializing ----------------------"); // First we must get a reference to a scheduler SchedulerFactory sf = new StdSchedulerFactory(); Scheduler sched = sf.getScheduler(); log.info("------- Initialization Complete -----------"); log.info("------- Scheduling Jobs -------------------"); // computer a time that is on the next round minute Date runTime = TriggerUtils.getEvenMinuteDate(new Date()); // define the job and tie it to our HelloJob class JobDetail job = new JobDetail("job1", "group1", HelloJob.class); // Trigger the job to run on the next round minute SimpleTrigger trigger = new SimpleTrigger("trigger1", "group1", runTime); // Tell quartz to schedule the job using our trigger sched.scheduleJob(job, trigger);/*w ww .j a v a 2 s. c o m*/ log.info(job.getFullName() + " will run at: " + runTime); // Start up the scheduler (nothing can actually run until the // scheduler has been started) sched.start(); log.info("------- Started Scheduler -----------------"); // wait long enough so that the scheduler as an opportunity to // run the job! log.info("------- Waiting 90 seconds... -------------"); try { // wait 90 seconds to show jobs Thread.sleep(90L * 1000L); // executing... } catch (Exception e) { } // shut down the scheduler log.info("------- Shutting Down ---------------------"); sched.shutdown(true); log.info("------- Shutdown Complete -----------------"); }
From source file:com.github.veithen.ulog.itest.jul.Test.java
public void testCommonsLogging() { Log log = LogFactory.getLog("test"); String msg = "test with commons logging"; log.info(msg); assertEquals(msg, handler.getLastRecord().getMessage()); }
From source file:com.github.veithen.ulog.itest.log4j.Test.java
public void testCommonsLogging() { Log log = LogFactory.getLog("test"); String msg = "test with commons logging"; log.info(msg); assertEquals(msg, appender.getLastEvent().getMessage()); }
From source file:com.winvector.logistic.demo.MapReduceLogisticTrain.java
@Override public int run(final String[] args) throws Exception { if (args.length != 3) { final Log log = LogFactory.getLog(MapReduceLogisticTrain.class); log.info(Licenses.licenses); log.fatal("use: MapReduceLogisticTrain trainFile formula resultFile"); return -1; }//from w ww .j a va 2 s. com final String trainFileName = args[0]; // file with input data in name=value pairs separated by tabs final String formulaStr = args[1]; // name of variable we expect to predict final String resultFileName = args[2]; run(trainFileName, formulaStr, null, resultFileName, 5); return 0; }
From source file:demo.config.CommonsJdbcLogger.java
@Override public void logDaoMethodEntering(String callerClassName, String callerMethodName, Object... parameters) { Log log = LogFactory.getLog(callerClassName); log.info("START " + callerClassName + "#" + callerMethodName); }
From source file:demo.config.CommonsJdbcLogger.java
@Override public void logDaoMethodExiting(String callerClassName, String callerMethodName, Object result) { Log log = LogFactory.getLog(callerClassName); log.info("END " + callerClassName + "#" + callerMethodName); }
From source file:demo.config.CommonsJdbcLogger.java
@Override public void logDaoMethodThrowing(String callerClassName, String callerMethodName, RuntimeException e) { Log log = LogFactory.getLog(callerClassName); log.info("END " + callerClassName + "#" + callerMethodName + " RuntimeException: " + e); }
From source file:demo.config.CommonsJdbcLogger.java
@Override public void logSqlExecutionSkipping(String callerClassName, String callerMethodName, SqlExecutionSkipCause cause) {/*w ww . j av a2 s. c o m*/ Log log = LogFactory.getLog(callerClassName); log.info("SKIPPED(" + cause.name() + ") " + callerClassName + "#" + callerMethodName); }