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.shin1ogawa.appengine.marketplace.controller.TopPageController.java

@Override
protected Navigation setUp() {
    domain = asString("domain");
    UserService us = UserServiceFactory.getUserService();
    currentUser = us.getCurrentUser();//  w  w  w .  jav  a 2  s  .co m
    if (currentUser == null) {
        if (StringUtils.isEmpty(domain)) {
            return redirect(Configuration.get().getMarketplaceListingUrl());
        }
        // if user had not been authenticated then send redirect to login url.
        String callbackURL = request.getRequestURL() + "?domain=" + domain;
        logger.log(Level.INFO, "had not been authenticated: callback=" + callbackURL);
        return redirect(us.createLoginURL(callbackURL, domain,
                "https://www.google.com/accounts/o8/site-xrds?hd=" + domain, null));
    } else {
        if (StringUtils.isEmpty(domain)) {
            String id = currentUser.getFederatedIdentity();
            int beginIndex = id.indexOf("://") + "://".length();
            int endIndex = id.indexOf('/', beginIndex);
            domain = id.substring(beginIndex, endIndex);
        } else if (StringUtils.contains(currentUser.getFederatedIdentity(), domain) == false) {
            // if user had been authenticated but invalid domain then send redirect to logout url.
            String callbackURL = request.getRequestURL() + "?domain=" + domain;
            logger.log(Level.INFO, "invalid domain: callback=" + callbackURL);
            return redirect(us.createLogoutURL(callbackURL, domain));
        }
    }
    delegate = IncreaseURLFetchDeadlineDelegate.install();
    NamespaceManager.set(domain);
    return super.setUp();
}

From source file:fr.gouv.vitam.utils.logging.CommonsLoggerFactory.java

@Override
protected void seLevelSpecific(final VitamLogLevel level) {
    // XXX FIXME does not work for Apache Commons Logger
    switch (level) {
    case TRACE:/*from ww w. j  a v a 2  s .c o m*/
        LogFactory.getFactory().setAttribute(LogFactory.PRIORITY_KEY, Level.FINEST);
        break;
    case DEBUG:
        LogFactory.getFactory().setAttribute(LogFactory.PRIORITY_KEY, Level.FINE);
        break;
    case INFO:
        LogFactory.getFactory().setAttribute(LogFactory.PRIORITY_KEY, Level.INFO);
        break;
    case WARN:
        LogFactory.getFactory().setAttribute(LogFactory.PRIORITY_KEY, Level.WARNING);
        break;
    case ERROR:
        LogFactory.getFactory().setAttribute(LogFactory.PRIORITY_KEY, Level.SEVERE);
        break;
    default:
        LogFactory.getFactory().setAttribute(LogFactory.PRIORITY_KEY, Level.WARNING);
        break;
    }
}

From source file:com.fegati.utilities.CSVPreprocessor.java

/**
 * Preprocess the CSV File, remove all the unmeaningful column and add
 * titles to the untitled header's columns.
 *
 * @param file - The original CSV file/*  w  ww.j  a  va2 s  . co m*/
 * @return The processed temporary CSV file
 * @throws IOException - Thrown while failed to access file
 */
private static List<String[]> preprocessCSVFile(File file) throws IOException {
    List<String[]> rows = readAllRowsFromCSVFile(file);

    LOGGER.log(Level.INFO, "Whole file read");
    System.out.println(rows.size());

    /* Get the highest column size */
    int columnSize = validateColumnSize(rows);
    for (String[] row : rows) {
        System.out.println(ArrayUtils.toString(row));
    }

    /* balance all the rows with the same column size */
    //balanceColumnsSizeOfTheRows(rows, columnSize);
    /* Add default title to the untitled header's columns */
    //titleHeader(rows);
    /* Create a temporary CSV file with the processed CSV contents */
    File processedFile = new File("/home/the_fegati/Downloads/FelixData/Batch1/preprocessed_labs.csv");
    //writeRowToCSVFile(processedFile, rows, columnSize);
    //return processedFile;
    return rows;
}

From source file:com.webpagebytes.wpbsample.SampleJob.java

public void execute(JobExecutionContext context) throws JobExecutionException {
    log.log(Level.INFO, "Sample quartz scheduler started");

    // create the email subject value
    Date yesterday = DateUtility.addDays(DateUtility.getToday(), -1);
    String subject = String.format("Sample webpagebytes application report(%d/%d/%d)",
            1900 + yesterday.getYear(), yesterday.getMonth() + 1, yesterday.getDate());

    // various variables used during report generation
    ByteArrayOutputStream bos_emailBody = new ByteArrayOutputStream(4096);
    ByteArrayOutputStream bos_emailAttachmentFop = new ByteArrayOutputStream(4096);
    InputStream is_emailAttachmentFop = null;
    ByteArrayOutputStream bos_emailAttachmentPdf = new ByteArrayOutputStream(4096);
    ByteArrayInputStream bis_emailAttachmentPdf = null;

    try {//from   ww  w  .j a va2s.co m
        // get the content provider instance
        WPBContentService contentService = WPBContentServiceFactory.getInstance();
        WPBContentProvider contentProvider = contentService.getContentProvider();

        // create the cmd model 
        WPBModel model = contentService.createModel();

        //get the report images for users, transactions, deposits and withdrawals
        // the images and stored in a map, the image content is base64 encoded
        Map<String, String> contentImages = new HashMap<String, String>();
        NotificationUtility.fetchReportImages(contentProvider, model, contentImages);

        //populate the model with image values
        model.getCmsApplicationModel().put("users_img",
                contentImages.get(NotificationUtility.CONTENT_IMG_USERS));
        model.getCmsApplicationModel().put("transactions_img",
                contentImages.get(NotificationUtility.CONTENT_IMG_TRANSACTIONS));
        model.getCmsApplicationModel().put("deposits_img",
                contentImages.get(NotificationUtility.CONTENT_IMG_DEPOSITS));
        model.getCmsApplicationModel().put("withdrawals_img",
                contentImages.get(NotificationUtility.CONTENT_IMG_WITHDRAWALS));

        // get from the GLOBALS parameters the user who will receive the email notification
        String notificationEmailAddress = model.getCmsModel().get(WPBModel.GLOBALS_KEY)
                .get("NOTIFICATIONS_EMAIL_ADDRESS");

        // get from the GLOBALS parameters the page guid with the email body template
        String notificationEmailPageGuid = model.getCmsModel().get(WPBModel.GLOBALS_KEY)
                .get("NOTIFICATIONS_EMAIL_PAGE_GUID");

        // get from the GLOBALS parameters the page guid with the PDF report XSL-FO template
        String notificationEmailAttachmentGuid = model.getCmsModel().get(WPBModel.GLOBALS_KEY)
                .get("NOTIFICATIONS_EMAIL_PDF_GUID");

        if (notificationEmailAddress == null || notificationEmailPageGuid == null
                || notificationEmailAttachmentGuid == null) {
            // if any of these is not set then do not sent the email
            log.log(Level.WARNING, "Sample scheduler not properly configured, will not send any email");
            return;
        }

        // translate the email body template into the actual body content
        contentProvider.writePageContent(notificationEmailPageGuid, model, bos_emailBody);

        // translate the attachment XSL FO template into the actual XSL FO content
        contentProvider.writePageContent(notificationEmailAttachmentGuid, model, bos_emailAttachmentFop);

        // need to convert the attachment XSL FO OutputStream into InputStream
        is_emailAttachmentFop = new ByteArrayInputStream(bos_emailAttachmentFop.toByteArray());

        SampleFopService fopService = SampleFopService.getInstance();
        fopService.getContent(is_emailAttachmentFop, MimeConstants.MIME_PDF, bos_emailAttachmentPdf);

        //need to convert the attachment PDF OutputStream into InputStream
        bis_emailAttachmentPdf = new ByteArrayInputStream(bos_emailAttachmentPdf.toByteArray());

        // now we have the email subject, email body, email attachment, we can sent it
        if (notificationEmailAddress.length() > 0) {
            EmailUtility emailUtility = EmailUtilityFactory.getInstance();
            emailUtility.sendEmail(notificationEmailAddress, "no-reply@webpagebytes.com", subject,
                    bos_emailBody.toString("UTF-8"), "report.pdf", bis_emailAttachmentPdf);
        }
        log.log(Level.INFO, "Sample quartz scheduler completed with success");

    } catch (Exception e) {
        log.log(Level.SEVERE, "Exception on quartz scheduler", e);
    } finally {
        IOUtils.closeQuietly(bos_emailBody);
        IOUtils.closeQuietly(bos_emailAttachmentFop);
        IOUtils.closeQuietly(is_emailAttachmentFop);
        IOUtils.closeQuietly(bis_emailAttachmentPdf);
        IOUtils.closeQuietly(bos_emailAttachmentPdf);
    }

}

From source file:namedatabasescraper.PageScraper.java

@SuppressWarnings("OverridableMethodCallInConstructor")
public PageScraper(File file, String dirname, String selector, String charset) throws IOException {
    filename = file.getAbsolutePath();/*from w w  w . j  ava2 s . c o m*/
    this.dirname = dirname;
    this.id = this.createScraperId();
    String html = FileUtils.readFileToString(file, charset);
    this.names = new ArrayList<>();
    Document soup = Jsoup.parse(html);
    //Elements nameElements = soup.select("a.nom");
    //Elements nameElements = soup.select("div > a:not(.n1)");
    Elements nameElements = soup.select(selector);
    for (Element nameElement : nameElements) {
        String name = nameElement.text();
        names.add(name);
    }
    logger.log(Level.INFO, "Scraped " + this.names.size() + " names from page {0}", file.getName());
}

From source file:com.amazon.carbonado.repo.tupl.LogEventListener.java

@Override
public void notify(EventType type, String message, Object... args) {
    int intLevel = type.level.intValue();

    Log log = mLog;/*w  w  w  . j av  a2s .  com*/
    if (log != null) {
        if (intLevel <= Level.INFO.intValue()) {
            if (type.category == EventType.Category.CHECKPOINT) {
                if (log.isDebugEnabled()) {
                    log.debug(format(type, message, args));
                }
            } else if (log.isInfoEnabled()) {
                log.info(format(type, message, args));
            }
        } else if (intLevel <= Level.WARNING.intValue()) {
            if (log.isWarnEnabled()) {
                log.warn(format(type, message, args));
            }
        } else if (intLevel <= Level.SEVERE.intValue()) {
            if (log.isFatalEnabled()) {
                log.fatal(format(type, message, args));
            }
        }
    }

    if (intLevel > Level.WARNING.intValue() && mPanicHandler != null) {
        mPanicHandler.onPanic(mDatabase, type, message, args);
    }
}

From source file:Classes.Database.java

private Database() {
    try {//from  w  w w.j  ava  2  s.  c  o  m
        if (DatabaseConnection(url)) {
            Logger.getAnonymousLogger().log(Level.INFO, "School db connected");
        } else {
            Logger.getAnonymousLogger().log(Level.INFO, "Cannot connect to any database");
        }
    } catch (SQLException e) {
        Logger.getAnonymousLogger().log(Level.WARNING, "SQLError in Constructor: " + e.getMessage(), e);
    }
}

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

/**
 * Handle action performed event.//from   w  ww . ja v  a 2s  .  c  o m
 * @param ae Event
 */
public void actionPerformed(ActionEvent ae) {
    try {
        URI uri = new URI(ApplicationContext.PROJECT_HELP_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 help web site {0}\n\n{1}",
                new Object[] { ApplicationContext.PROJECT_HELP_WEBSITE_URL, stack });
    }
}

From source file:com.calamp.services.kinesis.events.processor.CalAmpEventProcessor.java

/**
 * Sets the global log level to WARNING and the log level for this package to INFO,
 * so that we only see INFO messages for this processor. This is just for the purpose
 * of this tutorial, and should not be considered as best practice.
 *
 *//*  ww  w  .j  a  va 2s  . co  m*/
private static void setLogLevels() {
    ROOT_LOGGER.setLevel(Level.INFO);
    PROCESSOR_LOGGER.setLevel(Level.INFO);
}

From source file:co.com.runt.runistac.logica.TareasLogica.java

/**
 * Valida el nombre del nodo de ejecucion de la tarea
 *
 * @return/*from   w  w  w  .  ja va2 s  . co  m*/
 */
public boolean nombreNodo() {
    //WEBLOGIC
    //NOMBRE_NODO_EJECUTOR_INTERFAZ
    String triggerHostmame = parametroSistemaLogica.obtener("NODO_EJECUCION_TAREA_PROGRAMADA").getValor();
    String hostName = System.getProperty("weblogic.Name");
    Logger.getLogger(TareasLogica.class.getName()).log(Level.INFO, "HostName {0}",
            hostName + " - " + triggerHostmame);
    return triggerHostmame.contains(hostName);
}