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:onl.area51.fileserver.FileServer.java

/**
 * Instantiate this bean on startup./* w  w  w. j  a v a 2s  .c om*/
 *
 * @param registry
 * @param configurationService
 */
public void deploy(@Observes ActionRegistry registry, ConfigurationService configurationService) {
    Configuration mainConfig = configurationService.getConfiguration("fileserver");

    LOG.log(Level.INFO, "Mounting filesystems");

    Configuration fileSystemConfig = mainConfig.getConfiguration("filesystem");

    mainConfig
            .collection("filesystems").map(Functions.castTo(String.class)).map(n -> fileSystemConfig
                    .getConfiguration(n, () -> configurationService.getConfiguration("filesystem_" + n)))
            .forEach(fs -> {
                String prefix = FileSystemFactory.getPrefix(fs);

                LOG.log(Level.INFO, () -> "Registring filesystem " + prefix);

                try {
                    FileSystem fileSystem = FileSystemFactory.getFileSystem(fs);

                    registry.registerHandler(prefix + "*", HttpRequestHandlerBuilder.create().unscoped().log()
                            // Normal GET requests
                            .method("GET").add(FileSystemFactory.extractPath(fileSystem))
                            .ifAttributePresentSendOk("path", PathEntity::create)
                            .ifAttributeAbsentSendError("path", HttpStatus.SC_NOT_FOUND).end()
                            // HEAD requests
                            .method("HEAD").add(FileSystemFactory.extractPath(fileSystem))
                            .ifAttributePresentSendOk("path", PathEntity::createSizeOnly)
                            .ifAttributeAbsentSendError("path", HttpStatus.SC_NOT_FOUND).end()
                            // POST
                            .method("PUT").add(FileSystemFactory.extractPathMayNotExist(fileSystem))
                            .ifAttributePresent("path", new SaveContentAction())
                            .ifAttributeAbsentSendError("path", HttpStatus.SC_NOT_FOUND).end()
                            //
                            .build());
                } catch (IOException | URISyntaxException ex) {
                    LOG.log(Level.SEVERE, ex, () -> "Failed to register " + prefix);
                }
            });
}

From source file:com.agiletec.aps.util.ForJLogger.java

public boolean isInfoEnabled() {
    return _log.isLoggable(Level.INFO);
}

From source file:com.prime.shiftlog.ShiftLogManager.java

@PostConstruct
public void init() {
    logger.log(Level.INFO, "Initialize ShiftLog Manager");
    lazyModel = new LazyShiftLogDataModel(service);
}

From source file:at.ac.tuwien.dsg.esperstreamprocessing.service.TaskDelivery.java

public void deliver(Task task, String enrichmentInfo, String eventVals, String uri) {

    String content = task.getContent() + "\n" + "Detected: " + eventVals + "\n" + "More information: "
            + enrichmentInfo;/*w ww. jav a  2  s . c  o  m*/

    if (task != null) {

        List<NameValuePair> paramList = new ArrayList<NameValuePair>();
        paramList.add(new BasicNameValuePair("name", task.getName()));
        paramList.add(new BasicNameValuePair("content", content));
        paramList.add(new BasicNameValuePair("tag", task.getTag()));
        paramList.add(new BasicNameValuePair("severity", task.getSeverity().name()));

        RestHttpClient ws = new RestHttpClient(uri);
        ws.callPostMethod(paramList);
        //System.out.println("Forward Task !");
        String log = "Forward Task !" + paramList.toString();
        Logger.getLogger(EventHandler.class.getName()).log(Level.INFO, log);
    }
}

From source file:be.isl.desamouryv.sociall.service.FileServiceImpl.java

@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@Override/*from ww w  . j  ava  2  s. co  m*/
public void deleteFile(String fileName, String path) throws Exception {
    logger.log(Level.INFO, "delete file: {0}...", fileName);
    File file = new File(path + "\\" + fileName);
    boolean delete = file.delete();
    logger.log(Level.INFO, "... file deleted: {0}", delete);
    if (!delete) {
        throw new Exception("Failed to delete file");
    }
}

From source file:cz.cuni.mff.d3s.tools.perfdoc.server.measuring.MeasureRequestHandler.java

@Override
public void handle(HttpExchange exchange) throws IOException {
    log.log(Level.INFO, "Got new Ajax request. Starting to handle it.");

    //adding the right header
    Headers responseHeaders = exchange.getResponseHeaders();
    responseHeaders.set("Access-Control-Allow-Origin", "*");

    //getting the JSON request
    InputStream in = exchange.getRequestBody();

    //gets the body of the output
    OutputStream responseBody = exchange.getResponseBody();

    String userID = "";
    MethodMeasurer measurer = null;/*from   w w  w . ja v a 2  s .c  o m*/
    MeasureRequest measureRequest = null;

    try (BufferedReader rd = new BufferedReader(new InputStreamReader(in, Charset.forName("UTF-8")))) {
        String requestBody = readAll(rd);
        log.log(Level.CONFIG, "The incoming message is: {0}", requestBody);

        //parsing incoming request
        measureRequest = new MeasureRequest(requestBody);

        measurer = new MethodMeasurer(measureRequest, lockBase);

        JSONObject obj = measurer.measure();
        try {
            exchange.sendResponseHeaders(200, obj.toString().getBytes().length);
            responseBody.write(obj.toString().getBytes());
        } catch (IOException ex) {
            log.log(Level.INFO, "Unable to send the results to the client", ex);
        }
    } catch (ClassNotFoundException ec) {
        sendErrorMessage("Unable to find a testedMethod/generator class", exchange, responseBody);
    } catch (IllegalArgumentException ex) {
        sendErrorMessage("The bad parameters were sent to server (There might be an error in generator).",
                exchange, responseBody);
    } catch (NoSuchMethodException ex) {
        sendErrorMessage(ex.getMessage(), exchange, responseBody);
    } catch (IOException ex) {
        sendErrorMessage("There was some problem while reading some file on the server.", exchange,
                responseBody);
    } catch (SQLException ex) {
        log.log(Level.SEVERE, "There was some problem when connecting to database", ex);
    } catch (Exception e) {
        System.out.println(e);
        e.printStackTrace();
    } finally {
        try {
            in.close();
            responseBody.close();
        } catch (IOException ex) {
            //there is nothing we can do with it
            log.log(Level.INFO, "An exception occured when trying to close comunnication with client", ex);
        }
    }

    //results with highest priority are cached
    if (measurer != null && measureRequest != null
            && measureRequest.getMeasurementQuality().getPriority() == 4) {
        measurer.saveResultsAndCloseDatabaseConnection();
    }

    log.log(Level.INFO, "Data were succesfully sent to the user ({0}).", userID);
}

From source file:ca.sfu.federation.action.ShowWebSiteAction.java

/**
 * Handle action performed event.//from w ww  .j  av  a2 s.c  o m
 * @param ae Event
 */
public void actionPerformed(ActionEvent ae) {
    try {
        URI uri = new URI(ApplicationContext.PROJECT_WEBSITE_URL);
        // open the default web browser for the HTML page
        logger.log(Level.INFO, "Opening desktop browser to {0}", uri.toString());
        Desktop.getDesktop().browse(uri);
    } catch (Exception ex) {
        String stack = ExceptionUtils.getFullStackTrace(ex);
        logger.log(Level.WARNING, "Could not open browser for URL {0}\n\n{1}",
                new Object[] { ApplicationContext.PROJECT_WEBSITE_URL, stack });
    }
}

From source file:cz.incad.kramerius.k5indexer.KrameriusPDFDocument.java

public String getPage(int page) throws Exception {
    logger.log(Level.INFO, "Getting page {0}", page);
    try {/*from ww  w.j a  va2s  . c  o m*/
        PDFTextStripper stripper = new PDFTextStripper(/*"UTF-8"*/);
        if (page != -1) {
            stripper.setStartPage(page);
            stripper.setEndPage(page);
        }

        return StringEscapeUtils.escapeXml(stripper.getText(pdDoc));
    } catch (Exception ex) {
        return "";
    }
}

From source file:com.grosscommerce.ICEcat.utilities.Downloader.java

public static byte[] download(String urlFrom, String login, String pwd) throws Throwable {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    download(urlFrom, login, pwd, os);//www  .  ja  v  a  2 s.  co m
    byte[] result = os.toByteArray();
    os.close();
    Logger.getLogger(Downloader.class.getName()).log(Level.INFO, "Downloaded {0} byte(s)",
            new Object[] { result.length });

    return result;
}

From source file:com.neophob.sematrix.cli.PixelControllerCli.java

/**
 * //w  w  w  .jav a  2s  . c om
 */
public PixelControllerCli() {
    LOG.log(Level.INFO, "\n\nPixelController " + getVersion() + " - http://www.pixelinvaders.ch\n\n");
    fileUtils = new FileUtils();
    applicationConfig = InitApplication.loadConfiguration(fileUtils);

    LOG.log(Level.INFO, "Create Collector");
    this.collector = Collector.getInstance();

    LOG.log(Level.INFO, "Initialize System");
    this.collector.init(fileUtils, applicationConfig);
    framerate = new Framerate(applicationConfig.parseFps());

    LOG.log(Level.INFO, "Initialize TCP/OSC Server");
    this.collector.initDaemons(applicationConfig);

    LOG.log(Level.INFO, "Initialize Output device");
    this.output = InitApplication.getOutputDevice(this.collector, applicationConfig);
    if (this.output == null) {
        throw new IllegalArgumentException("No output device found!");
    }
    this.collector.setOutput(output);

    InitApplication.setupInitialConfig(collector, applicationConfig);

    LOG.log(Level.INFO, "--- PixelController Setup END ---");
    LOG.log(Level.INFO, "---------------------------------");
    LOG.log(Level.INFO, "");

}