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:at.rocworks.oa4j.logger.logger.DataSink.java

private boolean createGroup(NoSQLSettings configs, String grpprefix) {
    NoSQLGroup group = null;/*from  w  w w  . ja  va2  s.  com*/
    boolean grun = configs.getBoolProperty(grpprefix, "run", false);
    int scount = configs.getIntProperty(grpprefix, "servers", 1);
    String name = configs.getStringProperty(grpprefix, "name", grpprefix);

    JDebug.out.log(Level.INFO, "loading group {0} run={1} servers={2} name={3}",
            new Object[] { grpprefix, grun, scount, name });
    if (grun) {
        switch (configs.getDistribution()) {
        case ROBIN:
            group = new NoSQLGroupRobin(name, scount);
            break;
        case PINNED:
            group = new NoSQLGroupPinned(name, scount);
            break;
        default:
            JDebug.out.log(Level.SEVERE, "invalid distribution type {0}", configs.getDistribution());
        }
    }

    if (!grun || group == null) {
        return false;
    } else {
        logger.addNoSQLGroup(group);
    }

    for (int i = 0; i < scount; i++) {
        try {
            String srvprefix = grpprefix + ".server." + i;
            String type = configs.getStringProperty(srvprefix, "type", "");
            boolean srun = configs.getBoolProperty(srvprefix, "run", grun);
            if (!srun)
                continue;
            NoSQLSettings srvcfg;
            try {
                //srvcfg = configs.clone();
                srvcfg = configs.cloneWithNewPath(srvprefix);
            } catch (CloneNotSupportedException ex) {
                JDebug.StackTrace(Level.SEVERE, ex);
                return false;
            }
            //srvcfg.readProperties(srvprefix);
            JDebug.out.log(Level.CONFIG, "section {0}...", type);
            switch (type) {
            //                    case "com.etm.dbs.nosql.NoSQLCassandra":
            //                        {
            //                            NoSQLServer srv = com.etm.dbs.nosql.NoSQLCassandra.createServer(srvcfg, srvprefix);
            //                            group.setNoSQLServer(i, srv);
            //                            break;
            //                        }
            //                    case "com.etm.dbs.nosql.NoSQLMongoDB":
            //                        {
            //                            NoSQLServer srv = com.etm.dbs.nosql.NoSQLMongoDB.createServer(srvcfg, srvprefix);
            //                            group.setNoSQLServer(i, srv);
            //                            break;
            //                        }
            //                    case "com.etm.dbs.nosql.NoSQLElasticSearch":
            //                        {
            //                            NoSQLServer srv = com.etm.dbs.nosql.NoSQLElasticSearch.createServer(srvcfg, srvprefix);
            //                            group.setNoSQLServer(i, srv);
            //                            break;
            //                        }                    
            default: {
                Class<?> clazz = Class.forName(type);
                Method create = clazz.getMethod("createServer", NoSQLSettings.class, String.class);
                NoSQLServer srv = (NoSQLServer) create.invoke(null, srvcfg, srvprefix);
                group.setNoSQLServer(i, srv);
                break;
            }
            }
        } catch (ClassNotFoundException | NoSuchMethodException | SecurityException | IllegalAccessException
                | IllegalArgumentException ex) {
            JDebug.StackTrace(Level.SEVERE, ex);
        } catch (InvocationTargetException ex) {
            try {
                throw ex.getTargetException();
            } catch (Throwable throwable) {
                JDebug.StackTrace(Level.SEVERE, ex);
            }
        }
    }
    return true;
}

From source file:com.alehuo.wepas2016projekti.controller.AdminController.java

/**
 * Kommentin poistaminen sen ID:n perusteella Asetetaan lippu "deleted" true
 * -arvoon jotta kommentti ei ny. Tllin vltetn Data violation
 * exceptionit jne./*from  w ww . j a  v  a  2  s  .  co  m*/
 *
 * @param a Autentikointi
 * @param commentId Kommentin id
 * @return Nkym
 */
@Transactional
@RequestMapping(value = "/comment", method = RequestMethod.POST)
public String deleteComment(Authentication a, @RequestParam Long commentId) {
    Comment c = commentRepo.findOne(commentId);
    //Aseta pois nkyvilt
    c.setVisible(false);
    commentRepo.save(c);
    LOG.log(Level.INFO, "Paakayttaja ''{0}'' poisti kayttajan ''{1}'' kommentin viestin sisallolla \"{2}\"",
            new Object[] { a.getName(), c.getUser().getUsername(), c.getBody() });
    return "redirect:/";
}

From source file:com.github.jinahya.codec.BossVsEngineerTestCpuTimeDecode.java

@Test
public void testDecode() {

    final double[] consumedLikeABoss = new double[ROUNDS];
    final double[] consumedLikeAnEngineer = new double[ROUNDS];

    for (int i = 0; i < ROUNDS; i++) {
        final byte[] encoded = Tests.encodedBytes();
        if (ThreadLocalRandom.current().nextBoolean()) {
            consumedLikeABoss[i] = decodeLikeABoss(encoded);
            consumedLikeAnEngineer[i] = decodeLikeAnEngineer(encoded);
        } else {/*from w ww . ja va2 s  .  c  o  m*/
            consumedLikeAnEngineer[i] = decodeLikeAnEngineer(encoded);
            consumedLikeABoss[i] = decodeLikeABoss(encoded);
        }
    }

    LOGGER.log(Level.INFO, "consumed.like.a.boss: {0} [{1}, {2}, {3}, ..., {4}, {5}, {6}]",
            new Object[] { StatUtils.mean(consumedLikeABoss), consumedLikeABoss[0], consumedLikeABoss[1],
                    consumedLikeABoss[2], consumedLikeABoss[consumedLikeABoss.length - 3],
                    consumedLikeABoss[consumedLikeABoss.length - 2],
                    consumedLikeABoss[consumedLikeABoss.length - 1] });

    LOGGER.log(Level.INFO, "consumed.like.an.engineer: {0}" + " [{1}, {2}, {3}, ..., {4}, {5}, {6}]",
            new Object[] { StatUtils.mean(consumedLikeAnEngineer), consumedLikeAnEngineer[0],
                    consumedLikeAnEngineer[1], consumedLikeAnEngineer[2],
                    consumedLikeAnEngineer[consumedLikeAnEngineer.length - 3],
                    consumedLikeAnEngineer[consumedLikeAnEngineer.length - 2],
                    consumedLikeAnEngineer[consumedLikeAnEngineer.length - 1] });
}

From source file:com.github.jinahya.codec.BossVsEngineerTestCpuTimeEncode.java

@Test
public void testEncode() {

    final double[] consumedLikeABoss = new double[ROUNDS];
    final double[] consumedLikeAnEngineer = new double[ROUNDS];

    for (int i = 0; i < ROUNDS; i++) {
        final byte[] decoded = Tests.decodedBytes();
        if (ThreadLocalRandom.current().nextBoolean()) {
            consumedLikeABoss[i] = encodeLikeABoss(decoded);
            consumedLikeAnEngineer[i] = encodeLikeAnEngineer(decoded);
        } else {//  w  w  w . j av  a 2  s  .  c o  m
            consumedLikeAnEngineer[i] = encodeLikeAnEngineer(decoded);
            consumedLikeABoss[i] = encodeLikeABoss(decoded);
        }
    }

    LOGGER.log(Level.INFO, "consumed.like.a.boss: {0} [{1}, {2}, {3}, ..., {4}, {5}, {6}]",
            new Object[] { StatUtils.mean(consumedLikeABoss), consumedLikeABoss[0], consumedLikeABoss[1],
                    consumedLikeABoss[2], consumedLikeABoss[consumedLikeABoss.length - 3],
                    consumedLikeABoss[consumedLikeABoss.length - 2],
                    consumedLikeABoss[consumedLikeABoss.length - 1] });

    LOGGER.log(Level.INFO, "consumed.like.an.engineer: {0}" + " [{1}, {2}, {3}, ..., {4}, {5}, {6}]",
            new Object[] { StatUtils.mean(consumedLikeAnEngineer), consumedLikeAnEngineer[0],
                    consumedLikeAnEngineer[1], consumedLikeAnEngineer[2],
                    consumedLikeAnEngineer[consumedLikeAnEngineer.length - 3],
                    consumedLikeAnEngineer[consumedLikeAnEngineer.length - 2],
                    consumedLikeAnEngineer[consumedLikeAnEngineer.length - 1] });
}

From source file:com.silverpeas.openoffice.windows.FileWebDavAccessManager.java

/**
 * Retrieve the file from distant URL to local temp file.
 * @param url document url/*w w w .ja v a2s  . c  o m*/
 * @return full path of local temp file
 * @throws HttpException
 * @throws IOException
 */
public String retrieveFile(String url) throws HttpException, IOException {
    URI uri = getURI(url);
    WebdavManager webdav = new WebdavManager(uri.getHost(), userName, password);
    // Let's lock the file
    lockToken = webdav.lockFile(uri, userName);
    logger.log(Level.INFO, "{0}{1}{2}",
            new Object[] { MessageUtil.getMessage("info.webdav.locked"), ' ', lockToken });
    String tmpFile = webdav.getFile(uri, lockToken);
    logger.log(Level.INFO, "{0}{1}{2}",
            new Object[] { MessageUtil.getMessage("info.webdav.file.locally.saved"), ' ', tmpFile });
    return tmpFile;
}

From source file:com.kahlon.guard.controller.PersonImageManager.java

@PostConstruct
public void init() {
    logger.log(Level.INFO, "Initialize Person Profile Image Manager");
    if (context.getSelectedPerson() != null) {
        selectedPerson = context.getSelectedPerson();
        images = findPersonImages(selectedPerson);
        imageUpload = true;//from w  w  w.j  av  a 2 s  .c  o  m
    }
}

From source file:com.webpagebytes.cms.controllers.PageController.java

public <T> void notify(T t, AdminDataStorageOperation o, Class<? extends Object> type) {
    try {//from ww w . ja va2 s .  c  o  m
        if (type.equals(WPBPage.class)) {
            log.log(Level.INFO, "WbWebPage datastore notification, going to refresh the cache");
            wbWebPageCache.Refresh();
        }
    } catch (WPBIOException e) {
        // TBD
    }
}

From source file:com.almende.pi5.common.agents.LoggerAgent.java

/**
 * Forward all.//from ww w  . j  a v a 2 s . co  m
 */
public void forwardAll() {
    final Params params = new Params();
    params.add("data", logs);
    final JSONRequest request = new JSONRequest("addData", params);
    try {
        caller.call(graphs, request);
    } catch (IOException e) {
        LOG.log(Level.INFO, "Graphs agent not connected...");
    }
}

From source file:ke.co.pixie.daemon.JavaDaemon.java

/**
 * Starts the daemon.//  w ww. ja v a 2 s . c  o m
 */
@Override
public void start() {
    working = true;
    worker.start();
    DaemonLogger.log(Level.INFO, "Starting daemon...");
}

From source file:fyp.project.uploadFile.UploadFile.java

public int upLoad2Server(String sourceFileUri) {
    String upLoadServerUri = "http://vbacdu.ddns.net:8080/WBS/newjsp.jsp";
    // String [] string = sourceFileUri;
    String fileName = sourceFileUri;
    int serverResponseCode = 0;

    HttpURLConnection conn = null;
    DataOutputStream dos = null;//from ww w.  ja v a2  s  .c  o  m
    DataInputStream inStream = null;
    String lineEnd = "\r\n";
    String twoHyphens = "--";
    String boundary = "*****";
    int bytesRead, bytesAvailable, bufferSize;
    byte[] buffer;
    int maxBufferSize = 1 * 1024 * 1024;
    String responseFromServer = "";

    File sourceFile = new File(sourceFileUri);
    if (!sourceFile.isFile()) {

        return 0;
    }
    try { // open a URL connection to the Servlet
        FileInputStream fileInputStream = new FileInputStream(sourceFile);
        URL url = new URL(upLoadServerUri);
        conn = (HttpURLConnection) url.openConnection(); // Open a HTTP  connection to  the URL
        conn.setDoInput(true); // Allow Inputs
        conn.setDoOutput(true); // Allow Outputs
        conn.setUseCaches(false); // Don't use a Cached Copy
        conn.setRequestMethod("POST");
        conn.setRequestProperty("Connection", "Keep-Alive");
        conn.setRequestProperty("ENCTYPE", "multipart/form-data");
        conn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary);
        conn.setRequestProperty("file", fileName);
        dos = new DataOutputStream(conn.getOutputStream());

        dos.writeBytes(twoHyphens + boundary + lineEnd);
        dos.writeBytes("Content-Disposition: form-data; name=\"file\";filename=\""
                + fileName.substring(fileName.lastIndexOf("/")) + "\"" + lineEnd);

        m_log.log(Level.INFO, "Content-Disposition: form-data; name=\"file\";filename=\"{0}\"{1}",
                new Object[] { fileName.substring(fileName.lastIndexOf("/")), lineEnd });
        dos.writeBytes(lineEnd);

        bytesAvailable = fileInputStream.available(); // create a buffer of  maximum size

        bufferSize = Math.min(bytesAvailable, maxBufferSize);
        buffer = new byte[bufferSize];

        // read file and write it into form...
        bytesRead = fileInputStream.read(buffer, 0, bufferSize);

        while (bytesRead > 0) {
            dos.write(buffer, 0, bufferSize);
            bytesAvailable = fileInputStream.available();
            bufferSize = Math.min(bytesAvailable, maxBufferSize);
            bytesRead = fileInputStream.read(buffer, 0, bufferSize);
        }

        // send multipart form data necesssary after file data...
        dos.writeBytes(lineEnd);
        dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd);

        // Responses from the server (code and message)
        serverResponseCode = conn.getResponseCode();
        String serverResponseMessage = conn.getResponseMessage();

        m_log.log(Level.INFO, "Upload file to server" + "HTTP Response is : {0}: {1}",
                new Object[] { serverResponseMessage, serverResponseCode });

        // close streams
        m_log.log(Level.INFO, "Upload file to server{0} File is written", fileName);
        fileInputStream.close();
        dos.flush();
        dos.close();
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
        m_log.log(Level.ALL, "Upload file to server" + "error: " + ex.getMessage(), ex);
    } catch (Exception e) {
        e.printStackTrace();
    }
    //this block will give the response of upload link

    return serverResponseCode; // like 200 (Ok)

}