Example usage for java.util.logging Level INFO

List of usage examples for java.util.logging Level INFO

Introduction

In this page you can find the example usage for java.util.logging Level INFO.

Prototype

Level INFO

To view the source code for java.util.logging Level INFO.

Click Source Link

Document

INFO is a message level for informational messages.

Usage

From source file:org.cloudifysource.azure.AbstractCliAzureDeploymentTest.java

protected static void log(String message, Throwable t) {
    logger.log(Level.INFO, message, t);
}

From source file:QuickTest.java

@Test
public void testURI() throws URISyntaxException {
    final URI uri = new URI("/runrightfast.co/heartbeat/1/0");

    log.log(Level.INFO, "uri: {0}", uri);

    assertThat(uri, is(new URI("/runrightfast.co/heartbeat//1/0").normalize()));
    assertThat(uri, is(not(new URI("/runrightfast.co/heartbeat/1/1"))));

    log.info(String.format("reolved URI : %s",
            new URI("/runrightfast.co/").resolve("event-logging-service/").resolve(new URI("1/0"))));
}

From source file:edu.umass.cs.gnsclient.client.util.keystorage.SimpleKeyStore.java

/**
 *
 * @param args//  ww  w  .  ja va2  s  .c  o m
 */
public static void main(String[] args) {

    SimpleKeyStore keyStore = new SimpleKeyStore();
    if (args.length == 1 && args[0].startsWith("-drop")) {
        keyStore.dropTable(TABLE_NAME);
        GNSClientConfig.getLogger().info("Dropped table " + TABLE_NAME);
        keyStore.showAllTables();
    } else {
        try {
            keyStore.suppressUpdateRead = true;
            for (String key : keyStore.keys()) {
                GNSClientConfig.getLogger().log(Level.INFO, "{0} -> {1} '{'U:{2}, R:{3}'}'",
                        new Object[] { key, keyStore.get(key, null),
                                formatPrettyDateUTC(keyStore.updateTime(key)),
                                formatPrettyDateUTC(keyStore.readTime(key)) });
            }
        } finally {
            keyStore.suppressUpdateRead = false;
        }
        String value = "value-" + RandomString.randomString(6);
        GNSClientConfig.getLogger().log(Level.INFO, "Putting {0}", value);
        keyStore.put("frank", value);
        GNSClientConfig.getLogger().log(Level.INFO, "New value is {0}", keyStore.get("frank", null));
        keyStore.shutdown();
    }
}

From source file:fileoperations.FileOperations.java

public static boolean writeObjectToFile(Object ObjectToWrite, String fileToWrite) {
    loggerObj.log(Level.INFO, "inside writeObjectToFile method");
    BufferedWriter bw = null;//w  ww.j a va2 s  . c  o m
    loggerObj.log(Level.INFO, "File to write the object is:" + fileToWrite);
    File file = new File(fileToWrite);

    try {
        if (!file.exists()) {
            file.createNewFile();
            loggerObj.log(Level.INFO,
                    "File did not exist before: so created new one with the name: " + fileToWrite);
        }
        FileWriter fw = new FileWriter(file, true);
        bw = new BufferedWriter(fw);
        bw.write(ObjectToWrite.toString());

    } catch (IOException ex) {

        loggerObj.log(Level.SEVERE,
                "Error in writing to the file:" + fileToWrite + "\n Exception is " + ex.toString());
        return false;
    } catch (Exception ex) {
        loggerObj.log(Level.SEVERE,
                "Error in writing to the file:" + fileToWrite + "\n Exception is " + ex.toString());
        return false;
    } finally {
        try {
            if (bw != null) {
                bw.close();
            }
        } catch (IOException ex) {
            loggerObj.log(Level.SEVERE, "Error in closing the file:" + fileToWrite + " after reading");
            return false;
        }

    }
    loggerObj.log(Level.INFO, "Successfully written the object to: " + fileToWrite);
    return true;
}

From source file:com.googlecode.pondskum.client.ShutdownHttpClient.java

@Override
protected Void doInBackground() throws Exception {
    httpClient.getConnectionManager().shutdown();
    logger.log(Level.INFO, "Closing HttpClient.");
    return null;// ww w .j  av a2  s. c  o  m
}

From source file:edu.usu.sdl.openstorefront.service.manager.SolrManager.java

public static void init() {
    String url = PropertiesManager.getValue(PropertiesManager.KEY_SOLR_URL);
    if (StringUtils.isNotBlank(url)) {
        log.log(Level.INFO, MessageFormat.format("Connecting to Solr at {0}", url));
        solrServer = new HttpSolrServer(url);

    } else {/*  w  w  w . java 2  s .c  o  m*/
        log.log(Level.WARNING, "Solr property (" + PropertiesManager.KEY_SOLR_URL
                + ") is not set in openstorefront.properties. Search service unavailible. Using Mock");
        solrServer = new SolrServer() {

            @Override
            public NamedList<Object> request(SolrRequest request) throws SolrServerException, IOException {
                NamedList<Object> results = new NamedList<>();
                log.log(Level.INFO, "Mock Solr recieved request: " + request);
                return results;
            }

            @Override
            public void shutdown() {
                //do nothing
            }
        };
    }
}

From source file:com.okmich.hackerday.client.tool.ClientSimulator.java

/**
 *
 * @param file/* ww  w.  j  a va  2 s .  com*/
 * @param brokerUrl
 * @param topic
 */
public ClientSimulator(File file, String brokerUrl, String topic) {
    this.file = file;
    this.topic = topic;

    this.kafkaMessageProducer = new KafkaMessageProducer(brokerUrl);
    this.random = new Random(1234);
    LOG.log(Level.INFO, "Thread worker initialized to read from {0}", file);
}

From source file:com.l2jfree.util.logging.L2RuntimeLogFormatter.java

@Override
protected final void format0(LogRecord record, TextBuilder tb) {
    tb.append(record.getLevel()).append(" ");

    appendDate(record, tb);//from w  w w. j a  va  2 s  .  c o  m

    if (record.getLevel().intValue() > Level.INFO.intValue() || record.getThrown() != null)
        if (!StringUtils.isEmpty(record.getSourceClassName())
                && !StringUtils.isEmpty(record.getSourceMethodName()))
            tb.append(record.getSourceClassName()).append(".").append(record.getSourceMethodName())
                    .append("(): ");

    appendMessage(record, tb);
    appendThrown(record, tb);
}

From source file:net.hgw4.hal.SerialProtocol.java

public SerialProtocol(int num) {
    serialProtocolLogger = Logger.getLogger(SerialProtocol.class.getName());
    serialProtocolLogger.setLevel(Level.ALL);
    if (serialProtocolLogger.isLoggable(Level.INFO)) {
        serialProtocolLogger.info("SerialProtocol ");
    }/*from w w  w  .  j a  v a  2 s .  c om*/
    protocolNumber = num;
}

From source file:eu.flatworld.worldexplorer.layer.nltl7.NLTL7HTTPProvider.java

public NLTL7HTTPProvider() {
    LogX.log(Level.INFO, NAME + " starting");
    client = new HttpClient();

    Thread queueRunner = new Thread(this, this.getClass().getName() + "_queueRunner");
    queueRunner.setDaemon(true);//from  w  ww.  jav  a2  s  .c o  m
    queueRunner.start();
}