List of usage examples for org.apache.commons.logging LogFactory getLog
public static Log getLog(String name)
From source file:gridool.tools.MonetDBParallelLoader.java
public static void main(String[] args) { final DBPartitioningJobConf jobConf = new GetOptDBPartitioningJobConf(args); PartitioningJobType jobType = jobConf.getJobType(); LogFactory.getLog(MonetDBParallelLoader.class).info("jobType: " + jobType); final GridClient grid = new GridClient(); try {/*from w ww. j a va 2 s .co m*/ grid.execute(DBPartitioningJob.class, jobConf); } catch (RemoteException e) { e.printStackTrace(); } }
From source file:fr.free.hd.servers.LPCDraw.java
public static void main(String[] args) { String rootContextDirectoryClassPath = "/fr/free/hd/servers/"; String startupContextPath = rootContextDirectoryClassPath + "LPCDraw-startup-context.xml"; String richclientApplicationContextPath = rootContextDirectoryClassPath + "LPCDraw-application-context.xml"; String businessLayerContextPath = rootContextDirectoryClassPath + "LPCDraw-business-context.xml"; //String securityContextPath = rootContextDirectoryClassPath + "/standalone/security-context.xml"; try {/*from w w w . j a va2 s . c om*/ new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath, businessLayerContextPath /*, securityContextPath */ }); } catch (RuntimeException e) { LogFactory.getLog(LPCDraw.class).error("RuntimeException during startup", e); } }
From source file:net.sf.housekeeper.ApplicationController.java
/** * Starts the Housekeeper application with a Swing GUI. * /*ww w. j a v a2 s . co m*/ * @param args No parameters are used. */ public static void main(final String[] args) { final int jreVersion = JdkVersion.getMajorJavaVersion(); final int minVersion = JdkVersion.JAVA_15; if (jreVersion < minVersion) { LogFactory.getLog(ApplicationController.class).fatal("You need at least JRE 5.0 to run Housekeeper!"); System.exit(1); } String rootContextDirectoryClassPath = "/net/sf/housekeeper/config/"; String startupContextPath = rootContextDirectoryClassPath + "startup-context.xml"; String applicationContextPath = rootContextDirectoryClassPath + "application-context.xml"; String domainContextPath = rootContextDirectoryClassPath + "domain-context.xml"; new ApplicationLauncher(startupContextPath, new String[] { applicationContextPath, domainContextPath }); }
From source file:net.sf.housekeeper.Housekeeper.java
/** * Starts the Housekeeper application with a Swing GUI. * /*from ww w .jav a 2s . co m*/ * @param args "--debug" enables debugging messages. */ public static void main(final String[] args) { if (!SystemUtils.isJavaVersionAtLeast(140)) { LogFactory.getLog(Housekeeper.class).fatal("You need at least JRE 1.4 to run Housekeeper!"); System.exit(1); } new Housekeeper(args); }
From source file:gov.loc.repository.bagger.BaggerApplication.java
public static void main(String[] args) { String rootContextDirectoryClassPath = "/gov/loc/repository/bagger/ctx"; String startupContextPath = rootContextDirectoryClassPath + "/common/richclient-startup-context.xml"; String richclientApplicationContextPath = rootContextDirectoryClassPath + "/common/richclient-application-context.xml"; String businessLayerContextPath = rootContextDirectoryClassPath + "/common/business-layer-context.xml"; try {/*from w ww. ja va 2s . c o m*/ new ApplicationLauncher(startupContextPath, new String[] { richclientApplicationContextPath, businessLayerContextPath }); } catch (IllegalStateException ex1) { LogFactory.getLog(BaggerApplication.class).error("IllegalStateException during startup", ex1); JOptionPane.showMessageDialog(new JFrame(), "An illegal state error occured.\n", "Bagger startup error!", JOptionPane.ERROR_MESSAGE); System.exit(1); } catch (PropertyAccessException ex) { LogFactory.getLog(BaggerApplication.class).error("PropertyAccessException during startup", ex); JOptionPane.showMessageDialog(new JFrame(), "An error occured loading properties.\n", "Bagger startup error!", JOptionPane.ERROR_MESSAGE); System.exit(1); } catch (RuntimeException e) { LogFactory.getLog(BaggerApplication.class).error("RuntimeException during startup", e); String msg = e.getMessage(); if (msg.contains("SAXParseException")) { JOptionPane.showMessageDialog(new JFrame(), "An error occured parsing application context. You may have no internet access.\n", "Bagger startup error!", JOptionPane.ERROR_MESSAGE); } else { JOptionPane.showMessageDialog(new JFrame(), "An error occured during startup.\n", "Bagger startup error!", JOptionPane.ERROR_MESSAGE); } System.exit(1); } }
From source file:com.miraclelinux.historygluon.HistoryGluon.java
public static void main(String[] args) throws Exception { m_log = LogFactory.getLog(HistoryGluon.class); m_log.info("HistoryGluon, MIRACLE LINUX Corp. 2012"); if (!parseArgs(args)) return;/* www . j av a2s . co m*/ StorageDriver driver = null; String prefix = "com.miraclelinux.historygluon."; String driverName = prefix + m_storageName + "Driver"; try { Class<?> c = Class.forName(driverName); Class[] argTypes = { String[].class }; Constructor constructor = c.getConstructor(argTypes); Object[] driverArgs = { m_storageDriverArgs }; driver = (StorageDriver) constructor.newInstance(driverArgs); } catch (ClassNotFoundException e) { m_log.error("Unknown Storage Type: " + m_storageName); printUsage(); return; } catch (Exception e) { throw e; } if (!driver.init()) { m_log.fatal("Failed to initialize Storage Driver."); return; } m_log.info("StorageDriver: " + driver.getName()); if (m_isDeleteDBMode) { m_log.info("try to deleted DB..."); if (driver.deleteDB()) m_log.info("Success: Deleted DB"); else m_log.info("Failed: Deleted DB"); driver.close(); return; } ConnectionThread connectionThread = new ConnectionThread(DEFAULT_PORT, driver); connectionThread.start(); driver.close(); }
From source file:dk.qabi.imapfs.IMAPMount.java
public static void main(String[] args) throws MessagingException, MalformedURLException { if (args.length < 2) { System.out.println("[Error]: Must specify a mounting point"); System.out.println();// w w w.j a v a2s .c o m System.out.println("[Usage]: imapfsmnt <mounting point>"); System.exit(-1); } final String urlSpec = args[0]; final URL url = new URL(null, urlSpec, new IMAPStreamHandler()); final String mountpoint = args[1]; String[] fs_args = new String[4]; fs_args[0] = "-f"; fs_args[1] = "-s"; fs_args[2] = mountpoint; fs_args[3] = "-ovolname=" + url.getHost() + ",fssubtype=7"; Filesystem imapfs = new LoggingFilesystem(new IMAPFileSystem(url), LogFactory.getLog("dk.qabi.imapfs")); File m = new File(mountpoint); if (!m.exists()) m.mkdirs(); try { FuseMount.mount(fs_args, imapfs); } catch (Exception e) { e.printStackTrace(); } }
From source file:it.doqui.index.ecmengine.test.AllTests.java
public static void main(String[] args) { Log logger = LogFactory.getLog(ECMENGINE_TEST_LOG_CATEGORY); logger.debug("[AllTests::main] BEGIN"); String runner;/* w w w . j av a2 s .c o m*/ int i; String arguments[]; Class cls; runner = null; for (i = 0; (i < args.length) && (null == runner); i++) { if (args[i].equalsIgnoreCase("-text")) runner = "junit.textui.TestRunner"; else if (args[i].equalsIgnoreCase("-awt")) runner = "junit.awtui.TestRunner"; else if (args[i].equalsIgnoreCase("-swing")) runner = "junit.swingui.TestRunner"; } if (null != runner) { // remove it from the arguments arguments = new String[args.length - 1]; System.arraycopy(args, 0, arguments, 0, i - 1); System.arraycopy(args, i, arguments, i - 1, args.length - i); args = arguments; } else runner = "junit.swingui.TestRunner"; // append the test class arguments = new String[args.length + 1]; System.arraycopy(args, 0, arguments, 0, args.length); arguments[args.length] = "it.doqui.index.ecmengine.test.AllTests"; // invoke main() of the test runner try { cls = Class.forName(runner); java.lang.reflect.Method method = cls.getDeclaredMethod("main", new Class[] { String[].class }); method.invoke(null, new Object[] { arguments }); } catch (Throwable t) { logger.debug("[AllTests::main] Problem in test execution : " + t); } finally { logger.debug("[AllTests::main] BEGIN"); } }
From source file:net.sf.janos.Janos.java
/** * @param args/* w w w . j a v a2 s. c o m*/ * @throws Exception */ public static void main(String[] args) { if (args.length > 1) { System.out.println("Usage: Janos [port]"); System.exit(1); } if (args.length == 1) { System.setProperty("net.sbbi.upnp.Discovery.bindPort", args[0]); } /* * [DW] For some reason unknown to me, given: * 1) arch is intel * 2) os is Mac OS X * 3) running in eclipse * 4) using SWT * no exceptions are displayed in the eclipse console in the main thread. * To work around this, we just do everything in a new thread :-) */ if (Boolean.getBoolean("net.sf.janos.forkNewThread")) { try { Thread mainThread = new Thread(new Janos(), "Janos-SWT"); mainThread.start(); mainThread.join(); } catch (Throwable t) { LogFactory.getLog(Janos.class).fatal("Could not start thread: ", t); System.exit(1); } } else { new Janos().run(); } }
From source file:de.tobiasroeser.maven.featurebuilder.FeatureBuilder.java
public static void main(final String[] args) { try {//from ww w .j a v a2 s .c o m final int status = new FeatureBuilder().run(args); System.exit(status); } catch (final Throwable t) { LogFactory.getLog(FeatureBuilder.class).error("Caught an exception.", t); System.exit(1); } }