List of usage examples for java.util.logging Level INFO
Level INFO
To view the source code for java.util.logging Level INFO.
Click Source Link
From source file:email.mandrill.SendMail.java
public static MessageResponses sendMail(Message message) { try {/*from ww w . j a v a2 s . c o m*/ logger.log(Level.INFO, "Message:" + message.toJSONString()); HttpClient httpclient = HttpClients.createDefault(); HttpPost httppost = new HttpPost("https://mandrillapp.com/api/1.0/messages/send.json"); String request = message.toJSONString(); HttpEntity entity = new ByteArrayEntity(request.getBytes("UTF-8")); httppost.setEntity(entity); //Execute and get the response. HttpResponse response = httpclient.execute(httppost); HttpEntity responseEntity = response.getEntity(); if (responseEntity != null) { InputStream instream = responseEntity.getContent(); try { StringWriter writer = new StringWriter(); IOUtils.copy(instream, writer, "UTF-8"); String theString = writer.toString(); MessageResponses messageResponses = new MessageResponses(theString); //Do whateveer is needed with the response. logger.log(Level.INFO, theString); return messageResponses; } finally { instream.close(); } } } catch (Exception e) { logger.log(Level.SEVERE, util.Utility.logMessage(e, "Exception while updating org name:", null)); } return null; }
From source file:sandeep.kb.android.remote.utils.Utils.java
public static void log(String name, String string) { Logger.getLogger(name).log(Level.INFO, string.toString()); }
From source file:com.ontologycentral.ldspider.LDSpider_LogUtil.java
public static void setVerboseLogging() { Logger.getLogger("").setLevel(Level.INFO); Logger.getLogger("com.ontologycentral.ldspider").setLevel(Level.ALL); Logger.getLogger("").getHandlers()[0].setLevel(Level.ALL); }
From source file:com.google.oacurl.util.LoggingConfig.java
public static void init(boolean verbose) throws SecurityException, IOException { System.setProperty("org.apache.commons.logging.Log", "org.apache.commons.logging.impl.Jdk14Logger"); Logger defaultLogger = Logger.getLogger(""); if (verbose) { defaultLogger.setLevel(Level.INFO); } else {// www .j a va2 s . c o m defaultLogger.setLevel(Level.SEVERE); } }
From source file:com.grosscommerce.ICEcat.utilities.Downloader.java
public static void download(String urlFrom, String login, String pwd, OutputStream destStream) throws Exception { try {/* w w w. j av a 2s . co m*/ HttpURLConnection uc = prepareConnection(urlFrom, login, pwd); uc.connect(); if (uc.getResponseCode() != HttpURLConnection.HTTP_OK) { Logger.getLogger(Downloader.class.getName()).log(Level.INFO, "Error, code: {0}, message {1}", new Object[] { uc.getResponseCode(), uc.getResponseMessage() }); return; } BufferedInputStream is = null; if ((uc.getContentEncoding() != null && uc.getContentEncoding().toLowerCase().equals("gzip")) || uc.getContentType() != null && uc.getContentType().toLowerCase().contains("gzip")) { is = new BufferedInputStream(new GZIPInputStream(uc.getInputStream())); Logger.getLogger(Downloader.class.getName()).log(Level.INFO, "Will download gzip data from: {0}", urlFrom); } else { is = new BufferedInputStream(uc.getInputStream()); Logger.getLogger(Downloader.class.getName()).log(Level.INFO, "Will download not compressed data from:{0}", urlFrom); } StreamsHelper.copy(is, destStream); destStream.flush(); } catch (Exception ex) { Logger.getLogger(Downloader.class.getName()).log(Level.SEVERE, "URL: " + urlFrom, ex); throw ex; } }
From source file:org.apache.asterix.experiment.client.LSMExperimentSetRunner.java
public static void main(String[] args) throws Exception { java.util.logging.Logger.getLogger("org.apache.http.headers").setLevel(Level.FINEST); // LogManager.getRootLogger().setLevel(org.apache.log4j.Level.OFF); LSMExperimentSetRunnerConfig config = new LSMExperimentSetRunnerConfig( String.valueOf(System.currentTimeMillis()), 3); CmdLineParser clp = new CmdLineParser(config); try {/*from w w w . j av a2s. c o m*/ clp.parseArgument(args); } catch (CmdLineException e) { System.err.println(e.getMessage()); clp.printUsage(System.err); System.exit(1); } final String pkg = "org.apache.asterix.experiment.builder.suite"; Reflections reflections = //new Reflections("org.apache.asterix.experiment.builder.suite"); new Reflections(new ConfigurationBuilder().setUrls(ClasspathHelper.forPackage(pkg)) .filterInputsBy(new FilterBuilder().includePackage(pkg)) .setScanners(new TypeElementsScanner().publicOnly(), new MethodParameterScanner())); Map<String, AbstractLSMBaseExperimentBuilder> nameMap = new TreeMap<>(); for (Constructor c : reflections.getConstructorsMatchParams(LSMExperimentSetRunnerConfig.class)) { AbstractLSMBaseExperimentBuilder b = (AbstractLSMBaseExperimentBuilder) c.newInstance(config); nameMap.put(b.getName(), b); } Pattern p = config.getRegex() == null ? null : Pattern.compile(config.getRegex()); SequentialActionList exps = new SequentialActionList(); for (Map.Entry<String, AbstractLSMBaseExperimentBuilder> e : nameMap.entrySet()) { if (p == null || p.matcher(e.getKey()).matches()) { exps.add(e.getValue().build()); if (LOGGER.isLoggable(Level.INFO)) { LOGGER.info("Added " + e.getKey() + " to run list..."); } } } exps.perform(); }
From source file:maltcms.ui.fileHandles.properties.tools.ModelBuilder.java
public static WidgetTableModel getModel(Configuration properties, Object bean) { Vector<String> header = new Vector<>(); header.add("Key"); header.add("Value"); Logger.getLogger(ModelBuilder.class.getName()).log(Level.INFO, "properties: {0}", properties); return new WidgetTableModel(header, PropertyLoader.asHash(properties), bean); }
From source file:com.mmone.gpdati.allotment.reader.AvailCrud.java
public static void saveAllotment(XmlRpcClient client, Integer hotelCode, java.util.Date startDt, java.util.Date endDt, Integer roomId, int bookingLimit) throws Exception { int iBookingLimit = new Integer(bookingLimit); int xrpcresult = modifyAllotment(client, startDt, endDt, AVAIL_ACTION_SET, iBookingLimit, 0, roomId, hotelCode);//from ww w. ja v a 2 s .c om Logger.getLogger("AvailCrud").log(Level.INFO, "xrpcresult=" + xrpcresult); }
From source file:bridgempp.PermissionsManager.java
public static void loadAccessKeys() { ShadowManager.log(Level.INFO, "Loading all access keys..."); accessKeys = new HashMap<>(); int numberOfKeys = ConfigurationManager.permissionConfiguration.getRoot().getChild(0).getChildrenCount(); for (int i = 0; i < numberOfKeys; i++) { AccessKey key = AccessKey.readAccessKey(ConfigurationManager.permissionConfiguration, "keys.key(" + i + ")."); accessKeys.put(key.getKey(), key); }//from w w w .j a va 2 s . c o m ShadowManager.log(Level.INFO, "Loaded all access keys..."); }
From source file:cz.cas.lib.proarc.common.export.cejsh.CejshConfig.java
public static CejshConfig from(Configuration conf) { CejshConfig cc = new CejshConfig(); cc.setCejshXslUrl(conf.getString(PROP_MODS_XSL_URL, null)); // cc.setJournalUrl(conf.getString(PROP_JOURNALS_URL, null)); try {/*ww w . java2s . c o m*/ boolean debug = conf.getBoolean(PROP_DEBUG, Boolean.FALSE); cc.setLogLevel(debug ? Level.INFO : Level.FINE); } catch (ConversionException ex) { LOG.log(Level.SEVERE, PROP_DEBUG, ex); } return cc; }