private static void logTo(Log log, LogLevel level, Object message, Throwable throwable) { switch (level) { case TRACE: log.trace(message, throwable); return; case DEBUG: log.debug(message, throwable); return; case INFO: log.info(message, throwable); return; case WARN: log.warn(message, throwable); return; case ERROR: log.error(message, throwable); return; case FATAL: log.fatal(message, throwable); return; } }
/** * @param args Command line arguments */ public static void main(String[] args) { boolean result = false; try { JstormOnYarn client = new JstormOnYarn(); LOG.info("Initializing Client"); try { boolean doRun = client.init(args); if (!doRun) { System.exit(JOYConstants.EXIT_SUCCESS); } } catch (IllegalArgumentException e) { System.err.println(e.getLocalizedMessage()); client.printUsage(); System.exit(JOYConstants.EXIT_FAIL); } result = client.run(); } catch (Throwable t) { LOG.fatal("Error running Client", t); System.exit(JOYConstants.EXIT_FAIL); } if (result) { LOG.info("Application completed successfully"); System.exit(JOYConstants.EXIT_SUCCESS); } LOG.error("Application failed to complete successfully"); System.exit(JOYConstants.EXIT_FAIL); }
LOG.fatal("bad conf file: top-level element not <configuration>"); NodeList props = root.getChildNodes(); DeprecationContext deprecations = deprecationContext.get(); LOG.warn("bad conf file: element not <property>"); NodeList fields = prop.getChildNodes(); String attr = null; LOG.fatal("error parsing conf " + name, e); throw new RuntimeException(e); } catch (DOMException e) { LOG.fatal("error parsing conf " + name, e); throw new RuntimeException(e); } catch (SAXException e) { LOG.fatal("error parsing conf " + name, e); throw new RuntimeException(e); } catch (ParserConfigurationException e) { LOG.fatal("error parsing conf " + name , e); throw new RuntimeException(e);
/** * @param args Command line args */ public static void main(String[] args) { ApplicationMaster appMaster; try { appMaster = new ApplicationMaster(); appMaster.init(); if (appMaster.run()) { LOG.info("Application completed successfully."); System.exit(0); } else { LOG.info("Application failed."); System.exit(1); } } catch (Exception e) { LOG.fatal("Error running ApplicationMaster", e); System.exit(1); } }
LOG.warn("The transaction with id " + tx.getId() + " will NOT be rolled back as it is not an AUTHORIZE or AUTHORIZE_AND_CAPTURE transaction but is" + " of type " + tx.getType() + ". If you need to roll back transactions of this type then provide a customized rollback handler for" + " confirming transactions."); LOG.fatal("Unable to rollback transaction with id " + tx.getId() + ". The call was unsuccessful with" + " raw response: " + responseDTO.getRawResponse());
/** * Get back the R engine type options to initialize the REngine. * * @see REngine#init() */ @Override public boolean init() { String rType = System.getProperty("R.type"); if (rType == null || "".equals(rType)) { log.warn("No R type specified.\nusage:\n\tjava -DR.type=net ...\n" + "or\n\tjava -DR.type=jni ...\n\nConsidering network type"); rType = "net"; } if (!init(rType)) { if (log.isFatalEnabled()) { log.fatal("The initializing of R failed."); } return false; } return true; }
public static void main(String[] args) { showWelcome(); boolean result = false; try { LOG.info("Initializing Client"); Client client = new Client(args); client.init(); result = client.submitAndMonitor(); } catch (Exception e) { LOG.fatal("Error running Client", e); System.exit(1); } if (result) { LOG.info("Application completed successfully"); System.exit(0); } LOG.error("Application run failed!"); System.exit(2); } }
/** * Deal with the connection event. * * @param event the ZooKeeper event. */ @Override protected void processConnection(WatchedEvent event) { super.processConnection(event); switch (event.getState()) { case Disconnected: if (beenActiveMaster) { LOG.fatal(hostPort.getHostPort() + " disconnected from ZooKeeper, stop serving and exit immediately"); System.exit(0); } else { LOG.warn(hostPort.getHostPort() + " disconnected from ZooKeeper, wait to sync and try to become active master"); } break; default: break; } }
/** * @param args Command line args */ public static void main(String[] args) { boolean result = false; try { JstormMaster appMaster = new JstormMaster(); LOG.info("Initializing Jstorm Master!"); boolean doRun = appMaster.init(args); if (!doRun) { System.exit(JOYConstants.EXIT_SUCCESS); } appMaster.run(); // LRS won't finish at all result = appMaster.finish(); } catch (Throwable t) { LOG.fatal("Error running JstormMaster", t); LogManager.shutdown(); ExitUtil.terminate(JOYConstants.EXIT_FAIL1, t); } if (result) { LOG.info("Application Master completed successfully. exiting"); System.exit(JOYConstants.EXIT_SUCCESS); } else { LOG.info("Application Master failed. exiting"); System.exit(JOYConstants.EXIT_FAIL2); } }
public ObjectName register(MBeanServer server) { if (__log.isTraceEnabled()) __log.trace(ObjectPrinter.stringifyMethodEnter("register", new Object[] { "server", server })); try { server.unregisterMBean(getObjectName()); } catch (InstanceNotFoundException ex) { // ignore } catch (MBeanRegistrationException ex) { __log.fatal("Error unregistering mbean: " + getObjectName().getCanonicalName(), ex); } try { server.registerMBean(this, getObjectName()); } catch (Exception ex) { __log.warn("Exception on register(): " + createObjectName()); } return this.getObjectName(); }
public void log(int level, String message) { switch (level) { case Logger.INFO: LOGGER.info(message); break; case Logger.WARN: LOGGER.warn(message); break; case Logger.DEBUG: LOGGER.debug(message); break; case Logger.ERROR: LOGGER.error(message); break; case Logger.FATAL: LOGGER.fatal(message); break; default: break; } }
RollbackFailureException rollbackFailure = null; if (getAutoRollbackOnError()) { LOG.info(String.format("Exception ocurred in %s, executing rollback handlers", rollbackStateLocal.getWorkflowId())); LOG.fatal(String.format("There was an exception rolling back %s", rollbackStateLocal.getWorkflowId()), rollbackException);
public void run() { try { startLatch.await(); } catch (InterruptedException e) { logger.warn("Retry thread interupted for callback: " + callback.getWorkDescription()); return; } try { context.setDelegateContext(delegate.execute(callback, workManager)); } catch (Exception e) { this.exception = e; logger.fatal(e, e); } }
/** * @param args Command line arguments */ public static void main(String[] args) { boolean result = false; try { Client client = new Client(); LOG.info("Initializing Client"); try { boolean doRun = client.init(args); if (!doRun) { System.exit(0); } } catch (IllegalArgumentException e) { System.err.println(e.getLocalizedMessage()); System.exit(-1); } result = client.run(); } catch (Throwable t) { LOG.fatal("Error running Client", t); System.exit(1); } if (result) { LOG.info("Application completed successfully"); System.exit(0); } LOG.error("Application failed to complete successfully"); System.exit(2); }