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:com.plan.proyecto.servicios.gestionRelaciones.GestionRelacionesImplTest.java

/**
 * Test of mostrarCuentasSistema method, of class GestionRelacionesImpl.
 *//*from   w ww. j  a  v  a2s.  com*/
@Test
public void testMostrarCuentasSistema() {
    log.log(Level.INFO, "Muestra Cuentas Sistema");

    log.log(Level.INFO, "Prueba de mostrar cuentas");

    String password = "abcd";
    String email = "adddd@aaaaa.com";
    String nombre = "cesar";
    Date fecha = new Date();

    Cuenta cuenta = new Cuenta(email, password, nombre, fecha);

    gc.AltaCuenta(cuenta);

    List<Cuenta> cuentas = gc.mostrarCuentasSistema();

    assertEquals(cuentas.size(), 1);

    gc.BajaCuenta(cuenta);

    cuentas = gc.mostrarCuentasSistema();

    assertEquals(cuentas.size(), 0);
    log.log(Level.INFO, "Prueba de mostrar cuentas, terminada");
}

From source file:FileServer.ElasticSearch.ElasticSearchRetrievingInterface.java

public ResultsWrapper<DocumentResultEntity> queryDocument(QueryWrapper queryWrapper) {

    ObjectMapper mapper = new ObjectMapper();

    String url = fileQueryURL;/* ww w . j  a  v  a2s.  c o  m*/
    String query = QueryStringBuilder.buildDocumentQuery(queryWrapper);

    System.out.println(query);

    ResultsWrapper<DocumentResultEntity> resultList = new ResultsWrapper<>();
    List<DocumentResultEntity> retrievedResults = new ArrayList<>();

    try {

        HttpResponse<String> res = Unirest.post(url).body(query).asString();

        JsonNode root = mapper.readTree(res.getBody());

        System.out.println("*****************************************************************");
        System.out.println(mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root));
        Logger.getGlobal().log(Level.INFO, mapper.writerWithDefaultPrettyPrinter().writeValueAsString(root));

        resultList.setQuery(queryWrapper.extractedContentFeild);
        resultList.setSearchTime(root.get("took").toString());
        resultList.setResultNum(root.get("hits").get("total").toString());

        JsonNode jsonResultList = root.get("hits").get("hits");

        if (jsonResultList.isArray()) {
            for (JsonNode result : jsonResultList) {

                JsonNode content = result.get("_source");

                DocumentResultEntity resultEntity = new DocumentResultEntity();
                resultEntity.fileId = content.get("fileId").asText();
                resultEntity.filename = content.get("filename").asText();
                resultEntity.from = content.get("from").asText();
                resultEntity.to = content.get("to").asText();
                resultEntity.url = fileServerURL + content.get("filename").asText();

                JsonNode highlights = result.get("highlight");

                System.out.println(resultEntity.url);

                if (highlights != null) {
                    StringBuilder builder = new StringBuilder();
                    for (JsonNode snippet : highlights.get("extractedContent")) {
                        builder.append(snippet.asText() + ".....");
                        //fs.extractedContent += snippet.toString() + "...";
                    }

                    resultEntity.extractedContent = builder.toString();
                }

                retrievedResults.add(resultEntity);
            }
        }

        resultList.setResultList(retrievedResults);

    } catch (UnirestException ex) {
        Logger.getLogger(ElasticSearchRetrievingInterface.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(ElasticSearchRetrievingInterface.class.getName()).log(Level.SEVERE, null, ex);
    }

    return resultList;

}

From source file:com.elasticgrid.examples.video.MencoderEncoder.java

public MencoderEncoder(boolean enableLog) {
    this.enableLog = enableLog;
    String rioHome = System.getProperty("org.rioproject.home");
    if (rioHome == null) {
        throw new NullPointerException("Rio home property should be set!");
    }//  ww w. java2  s.co  m
    String osName = System.getProperty("os.name");
    try {
        if (osName.contains("Windows")) {
            encoderLocation = "mencoder.exe";
        } else if (osName.contains("Linux")) {
            encoderLocation = "mencoder";
        } else if (osName.contains("Mac")) {
            encoderLocation = "mencoder";
        } else {
            throw new RuntimeException("Unsupported OS: " + osName);
        }
        logger.log(Level.INFO, "Using encoder located in {0}", encoderLocation);
    } catch (Exception e) {
        throw new RuntimeException("Can't find appropriate mencoder software", e);
    }
}

From source file:com.samir.commons.java.jarinstallerkit.jarinstaller.JarInstaller.java

public void starter(final String[] args) throws Exception {
    LOGGER.log(Level.INFO, "shutdown Previous");
    shutdownPrevious();//w ww  .  j av a2  s.  com
    LOGGER.log(Level.INFO, "start disconnector Service");
    disconnectorService();
    File finalDir = new File(Constants.getInstallDirectorySeparator());
    if (finalDir.canWrite()) {
        doInstallLifeCycle(args);
    }
    //Remove the old tmp file
    try {
        File appTmp = new File(Constants.FINAL_APP_TMP);
        if (appTmp.exists()) {
            appTmp.delete();
        }
    } catch (Exception e) {
    }

}

From source file:to.sparks.mtgox.example.WebsocketExamples.java

@Override
public void onApplicationEvent(StreamEvent event) {

    if (event instanceof DepthEvent) {
        Depth depth = (Depth) event.getPayload();
        logger.log(Level.INFO, "Depth: {0}", new Object[] { depth.getTotalVolume().toPlainString() });

    } else if (event instanceof TickerEvent) {
        Ticker ticker = (Ticker) event.getPayload();
        logger.log(Level.INFO, "Last: {0}", new Object[] { ticker.getLast().toPlainString() });
    } else if (event instanceof TradeEvent) {
        Trade trade = (Trade) event.getPayload();
        logger.log(Level.INFO, "Trade: {0} {1}",
                new Object[] { trade.getPrice_currency(), trade.getPrice().toPlainString() });
    }/*from   ww w.j  a  v  a2 s  .c  o m*/
}

From source file:com.github.diluka.dynamic.web.staticizer.filter.DynamicWebStaticizerFilter.java

@Override
public void init(FilterConfig filterConfig) throws ServletException {
    if (defaultConfigDeciderFactory == null) {
        defaultConfigDeciderFactory = new DefaultConfigDeciderFactory();
    }// w w  w  .  j  a  va2  s  .  c o m

    deciders.addAll(defaultConfigDeciderFactory.getDefaultDeciders());

    Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Staticizer Initialized. ");
}

From source file:com.intbit.dao.ScheduleSocialPostDAO.java

public static Map<String, Integer> addToScheduleSocialPost(int userId, String imageName,
        Map<String, Object> tokenDataMap, Map<String, Object> metadataMap, String type, String scheduleTitle,
        String scheduleDesc, Timestamp scheduleTime, String templateStatus, Connection conn)
        throws SQLException {
    String sql = "INSERT INTO tbl_scheduled_socialpost_list "
            + " (user_id, image_name, token_data, metadata, type) VALUES" + " (?, ?, ?, ?, ?) RETURNING id";
    Map<String, Integer> methodResponse = new HashMap<>();
    int scheduleSocialPostId = -1;
    try {//from   ww  w.  java 2  s  . co  m
        try (PreparedStatement ps = conn.prepareStatement(sql)) {
            ps.setInt(1, userId);
            ps.setString(2, imageName);

            PGobject tokenData = new PGobject();
            tokenData.setType("json");
            tokenData.setValue(AppConstants.GSON.toJson(tokenDataMap));
            ps.setObject(3, tokenData);

            PGobject metadata = new PGobject();
            metadata.setType("json");
            metadata.setValue(AppConstants.GSON.toJson(metadataMap));
            ps.setObject(4, metadata);

            ps.setString(5, type);
            ps.execute();
            try (ResultSet rs = ps.getResultSet()) {
                if (rs.next()) {
                    scheduleSocialPostId = rs.getInt(1);
                    methodResponse.put("schedule_socialpost_id", scheduleSocialPostId);
                    logger.log(Level.INFO, "Id of Scheduled Social Post: " + scheduleSocialPostId);
                }
            }

        }
        int scheduleId = ScheduleDAO.addToScheduleEntityList(scheduleSocialPostId, scheduleTitle, scheduleDesc,
                scheduleTime, type, templateStatus, userId, conn);
        methodResponse.put("schedule_entity_id", scheduleId);
    } catch (SQLException ex) {
        logger.log(Level.SEVERE, null, ex);
        throw ex;
    }

    return methodResponse;
}

From source file:net.openhft.chronicle.logger.jul.JulTestBase.java

protected static void log(Logger logger, ChronicleLogLevel level, String fmt, Object... args) {
    switch (level) {
    case TRACE://from  ww w  .  ja v  a2s  .c  om
        logger.log(Level.ALL, fmt, args);
        break;
    case DEBUG:
        logger.log(Level.FINE, fmt, args);
        break;
    case INFO:
        logger.log(Level.INFO, fmt, args);
        break;
    case WARN:
        logger.log(Level.WARNING, fmt, args);
        break;
    case ERROR:
        logger.log(Level.SEVERE, fmt, args);
        break;
    default:
        throw new UnsupportedOperationException();
    }
}

From source file:com.prime.location.billing.InvoicedBillingManager.java

@PostConstruct
public void init() {
    logger.log(Level.INFO, "Initialize Agency Invoiced Billing Manager");
}

From source file:com.mdmserver.mdb.ControllerQueue.java

private void sendGCMMessge(String cloudId, String jsonData) {
    try {//from  w ww  .  j  a  v a  2  s .c  o  m
        //                Request.Post("http://android.googleapis.com/gcm/send").setHeader("Authorization", "key="+Config.gcmServerId)
        //                        .bodyString("{\"registration_ids\":[\""+cloudId+"\"],\"data\": {\"1\":\"2\",\"3\":\"4\"}}", ContentType.APPLICATION_JSON)
        //                        .execute().returnContent();
        Logger.getLogger("Avin").log(Level.INFO,
                "{\"registration_ids\":[\"" + cloudId + "\"],\"data\":" + jsonData + "}");
        Request.Post("http://android.googleapis.com/gcm/send")
                .setHeader("Authorization", "key=" + Config.gcmServerId)
                .bodyString("{\"registration_ids\":[\"" + cloudId + "\"],\"data\":" + jsonData + "}",
                        ContentType.APPLICATION_JSON)
                .execute().returnContent();
        System.out.println("Sending----------------------");
    } catch (IOException ex) {
        Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, null, ex);
    }
}