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:schemacrawler.tools.integration.spring.SchemaCrawlerSpringCommandLine.java

@Override
public void execute() throws Exception {
    final Path contextFile = Paths.get(springOptions.getContextFileName()).normalize().toAbsolutePath();
    final ApplicationContext appContext;
    if (exists(contextFile)) {
        final String contextFilePath = contextFile.toUri().toString();
        LOGGER.log(Level.INFO, "Loading context from file, " + contextFilePath);
        appContext = new FileSystemXmlApplicationContext(contextFilePath);
    } else {/*  w ww.j  av  a 2 s  . co m*/
        LOGGER.log(Level.INFO, "Loading context from classpath, " + springOptions.getContextFileName());
        appContext = new ClassPathXmlApplicationContext(springOptions.getContextFileName());
    }

    try {
        final DataSource dataSource = (DataSource) appContext.getBean(springOptions.getDataSourceName());
        try (Connection connection = dataSource.getConnection();) {
            final Executable executable = (Executable) appContext.getBean(springOptions.getExecutableName());
            executable.execute(connection);
        }
    } finally {
        ((AbstractXmlApplicationContext) appContext).close();
    }
}

From source file:cz.incad.kramerius.client.tools.IndexConfig.java

public IndexConfig() throws IOException, JSONException {
    String path = System.getProperty("user.home") + File.separator + ".kramerius4" + File.separator + "k5client"
            + File.separator + "fields.json";
    //        File f = new File(path);
    //        if (!f.exists() || !f.canRead()) {
    //            f = FileUtils.toFile(IndexConfig.class.getResource("/cz/incad/kramerius/client/tools/fields.json"));
    //        }/* ww  w.  j  ava  2 s  .  c om*/
    File fdef = FileUtils.toFile(IndexConfig.class.getResource("/cz/incad/kramerius/client/tools/fields.json"));
    String json = FileUtils.readFileToString(fdef, "UTF-8");
    fieldsConfig = new JSONObject(json);

    File f = new File(path);
    if (f.exists() && f.canRead()) {
        json = FileUtils.readFileToString(f, "UTF-8");
        JSONObject confCustom = new JSONObject(json);
        Iterator keys = confCustom.keys();
        while (keys.hasNext()) {
            String key = (String) keys.next();
            LOGGER.log(Level.INFO, "key {0} will be overrided", key);
            fieldsConfig.put(key, confCustom.get(key));
        }
    }

    mappings = fieldsConfig.getJSONObject("mappings");
}

From source file:net.sf.mpaxs.spi.computeHost.Host.java

@Override
public void configure(Configuration cfg) {
    settings = new Settings(cfg);
    Logger.getLogger(Host.class.getName()).log(Level.INFO, "Running ComputeHost at IP {0}",
            settings.getLocalIp());/*  www. jav a 2  s.  c  om*/
    File baseDir = new File(settings.getOption(ConfigurationKeys.KEY_COMPUTE_HOST_WORKING_DIR));
    try {
        //remove leftovers from previous run
        FileUtils.deleteDirectory(baseDir);
    } catch (IOException ex) {
        Logger.getLogger(Host.class.getName()).log(Level.SEVERE, null, ex);
    }
    baseDir.mkdirs();
    settings.setOption(ConfigurationKeys.KEY_COMPUTE_HOST_ERROR_FILE,
            new File(baseDir, "error.txt").getAbsolutePath());
    settings.setOption(ConfigurationKeys.KEY_COMPUTE_HOST_OUTPUT_FILE,
            new File(baseDir, "output.txt").getAbsolutePath());
    try {
        System.setErr(new PrintStream(
                new FileOutputStream(settings.getOption(ConfigurationKeys.KEY_COMPUTE_HOST_ERROR_FILE))));
        System.setOut(new PrintStream(
                new FileOutputStream(settings.getOption(ConfigurationKeys.KEY_COMPUTE_HOST_OUTPUT_FILE))));
    } catch (FileNotFoundException ex) {
        Logger.getLogger(Host.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:by.bsuir.finance.controllers.AccountantController.java

@RequestMapping(value = "/details", method = RequestMethod.GET)
@ResponseBody//from  ww  w. j a  v a 2s  . c  om
public ModelAndView details(@RequestParam("idUserInfo") int idUserInfo) {
    ModelAndView model = new ModelAndView("accountant/details");
    UserInfo info = null;
    try {
        info = infoService.findById(idUserInfo);
    } catch (UserInfoNotFoundException e) {
        log.log(Level.SEVERE, e.getMessage());
    }
    log.log(Level.INFO, "info : {0}", info);
    model.addObject("command", info);
    model.addObject("userinfo", info);

    return model;
}

From source file:de.tuberlin.uebb.jdae.simulation.DefaultSimulationRuntime.java

public DefaultSimulationRuntime(Logger l) {
    super();
    this.logger = l;
    logger.setLevel(Level.INFO);
}

From source file:org.cloudifysource.rest.util.AdminFactoryBean.java

@Override
public void afterPropertiesSet() throws Exception {
    if (SecurityPropagation.CLUSTER.equals(securityPropagation)) {
        final org.springframework.security.core.userdetails.UserDetails userDetails = (org.springframework.security.core.userdetails.UserDetails) SecurityContextHolder
                .getContext().getAuthentication().getPrincipal();
        adminFactory.userDetails(userDetails.getUsername(), userDetails.getPassword());
    }/*from   ww  w  .jav a  2 s  . c  o  m*/
    admin = adminFactory.createAdmin();
    if (logger.isLoggable(Level.INFO)) {
        LookupLocator[] locators = admin.getLocators();
        String[] locatorStrings = new String[locators.length];
        for (int i = 0; i < locators.length; i++) {
            locatorStrings[i] = locators[i].getHost() + ":" + locators[i].getPort();
        }
        logger.info("Admin using lookup locators=" + Arrays.toString(locatorStrings) + " groups="
                + Arrays.toString(admin.getGroups()));
    }
}

From source file:at.ac.tuwien.dsg.dataassetloader.store.DataAssetFunctionStore.java

public String getDataAssetFunction(String dataAssetID) {

    String dafXML = "";
    try {// w  w w.j  a v  a2  s.  c  o m
        InputStream inputStream = null;

        String sql = "select * from DataAssetFunction WHERE dataAssetID='" + dataAssetID + "'";
        ResultSet rs = connectionManager.ExecuteQuery(sql);

        try {
            while (rs.next()) {
                inputStream = rs.getBinaryStream("dataAssetFunction");
            }

            rs.close();
        } catch (SQLException ex) {
            Logger.getLogger(DataAssetFunctionStore.class.getName()).log(Level.SEVERE, null, ex);
        }

        StringWriter writer = new StringWriter();
        String encoding = StandardCharsets.UTF_8.name();

        IOUtils.copy(inputStream, writer, encoding);
        dafXML = writer.toString();
        Logger.getLogger(DataAssetFunctionStore.class.getName()).log(Level.INFO, null, "DAF XML: " + dafXML);

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

    return dafXML;
}

From source file:com.example.getstarted.util.CloudStorageHelper.java

/**
 * Uploads a file to Google Cloud Storage to the bucket specified in the BUCKET_NAME
 * environment variable, appending a timestamp to end of the uploaded filename.
 *///from   w  ww. j av a  2s  .c o  m
public String uploadFile(FileItemStream fileStream, final String bucketName)
        throws IOException, ServletException {
    checkFileExtension(fileStream.getName());

    DateTimeFormatter dtf = DateTimeFormat.forPattern("-YYYY-MM-dd-HHmmssSSS");
    DateTime dt = DateTime.now(DateTimeZone.UTC);
    String dtString = dt.toString(dtf);
    final String fileName = fileStream.getName() + dtString;

    // the inputstream is closed by default, so we don't need to close it here
    BlobInfo blobInfo = storage.create(BlobInfo.newBuilder(bucketName, fileName)
            // Modify access list to allow all users with link to read file
            .setAcl(new ArrayList<>(Arrays.asList(Acl.of(User.ofAllUsers(), Role.READER)))).build(),
            fileStream.openStream());
    logger.log(Level.INFO, "Uploaded file {0} as {1}", new Object[] { fileStream.getName(), fileName });
    // return the public download link
    return blobInfo.getMediaLink();
}

From source file:io.stallion.services.Log.java

public static Level getLogLevel() {

    if (logger == null) {
        return Level.OFF;
    } else if (logger.getLevel() == null) {

        return Level.INFO;
    } else {/*from w w  w .j a  v a2 s . c o m*/
        return logger.getLevel();
    }
}

From source file:com.ChatEndpoint.java

@OnMessage
public void onMessage(final Session session, String msg) throws IOException {
    System.out.println(msg);//from  www .  j  a  v  a2 s .co  m
    SesionWeb sesion = new SesionWeb(session);
    try {
        JSONObject objetoJSON = new JSONObject(msg);
        switch (getTipo(objetoJSON.getString("tipo"))) {
        /**
         * Inciar sesion por parte del cliente.
         */
        case LOGIN: {
            this.logear(session, objetoJSON);
        }
            break;
        /**
         * Al recibir algun mensaje(chat) del cliente.
         */
        case MENSAJE: {
            this.mensaje(session, objetoJSON);
        }
            break;
        /**
         * Cuando alguien toca el codigo js y el tipo mensaje no es uno
         * de los posibles.
         */
        case ERROR: {
            sesion.notificarError(TipoMensaje.ERROR, "Okey... Que intentas hacer? :(");
        }
            break;
        }
    } catch (JSONException e) {
        log.log(Level.INFO, "{0}Error de json ", e.toString());
        sesion.notificarError(TipoMensaje.ERROR, "Error sintaxis JSON. Mira la consola.");
    }
}