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.alehuo.wepas2016projekti.controller.SearchController.java

/**
 * Haun ksittely//from w w w .  jav  a 2 s  .com
 *
 * @param a Autentikointi
 * @param m Malli
 * @param searchTerm Hakutermi
 * @return
 */
@RequestMapping(method = RequestMethod.POST)
public String doSearch(Authentication a, Model m, @RequestParam String searchTerm) {
    LOG.log(Level.INFO, "Kayttaja ''{0}'' haki hakusanalla ''{1}''.", new Object[] { a.getName(), searchTerm });

    m.addAttribute("user", userService.getUserByUsername(a.getName()));
    if (!searchTerm.trim().isEmpty()) {
        //Lista kyttjtileist
        m.addAttribute("userlist", userService.getUsersByUsernameLike(searchTerm));
    }

    return "search";
}

From source file:com.github.mike10004.stormpathacctmgr.NewPasswordFormServlet.java

/**
 * Handles the HTTP {@code GET} method. Gets the password reset token 
 * parameter value from the request query string and forwards to 
 * a JSP page for rendering.//from   w  w w .j a v a2  s.c  om
 *
 * @param request servlet request
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException, ResourceException {
    boolean tokenVerified = false;
    String token = request.getParameter(PasswordReset.PARAM_RESET_TOKEN);
    if (token != null && !token.isEmpty()) {
        checkNotNullAndNotEmpty(token, "token");
        Stormpaths stormpaths = createStormpaths();
        Application application = stormpaths.buildApplication();
        Account account;
        try {
            account = application.verifyPasswordResetToken(token);
            tokenVerified = true;
            log.log(Level.INFO, "verified token {0} and got account {1}",
                    new Object[] { StringUtils.abbreviate(token, 32), account.getEmail() });
            request.setAttribute(ATTR_TARGET_EMAIL, account.getEmail());
        } catch (ResourceException e) {
            log.log(Level.INFO, "verifyPasswordResetToken failed: {0}", (Object) e);
        }
    } else {
        log.info("'sptoken' query parameter is empty or not present");
    }
    request.setAttribute(ATTR_TOKEN_VERIFIED, tokenVerified);
    RequestDispatcher dispatcher = request.getRequestDispatcher(RESET_ENTER_NEW_PASSWORD_JSP_PATH);
    dispatcher.forward(request, response);
}

From source file:com.mg.jet.birt.report.data.oda.ejbql.HibernateUtil.java

private static synchronized void initSessionFactory(String hibfile, String mapdir, String jndiName)
        throws HibernateException {
    //ClassLoader cl1;

    if (sessionFactory == null) {

        if (jndiName == null || jndiName.trim().length() == 0)
            jndiName = CommonConstant.DEFAULT_JNDI_URL;
        Context initCtx = null;/*from  w ww.  j a v  a  2  s .c o  m*/
        try {
            initCtx = new InitialContext();
            sessionFactory = (SessionFactory) initCtx.lookup(jndiName);
            return;
        } catch (Exception e) {
            logger.log(Level.INFO, "Unable to get JNDI data source connection", e);
        } finally {
            if (initCtx != null)
                try {
                    initCtx.close();
                } catch (NamingException e) {
                    //ignore
                }
        }

        Thread thread = Thread.currentThread();
        try {
            //Class.forName("org.hibernate.Configuration");
            //Configuration ffff = new Configuration();
            //Class.forName("org.apache.commons.logging.LogFactory");

            oldloader = thread.getContextClassLoader();
            //Class thwy = oldloader.loadClass("org.hibernate.cfg.Configuration");
            //Class thwy2 = oldloader.loadClass("org.apache.commons.logging.LogFactory");
            //refreshURLs();
            //ClassLoader changeLoader = new URLClassLoader( (URL [])URLList.toArray(new URL[0]),HibernateUtil.class.getClassLoader());
            ClassLoader testLoader = new URLClassLoader((URL[]) URLList.toArray(new URL[0]), pluginLoader);
            //changeLoader = new URLClassLoader( (URL [])URLList.toArray(new URL[0]));

            thread.setContextClassLoader(testLoader);
            //Class thwy2 = changeLoader.loadClass("org.hibernate.cfg.Configuration");
            //Class.forName("org.apache.commons.logging.LogFactory", true, changeLoader);
            //Class cls = Class.forName("org.hibernate.cfg.Configuration", true, changeLoader);
            //Configuration cfg=null;
            //cfg = new Configuration();
            //Object oo = cls.newInstance();
            //Configuration cfg = (Configuration)oo;
            Configuration cfg = new Configuration();
            buildConfig(hibfile, mapdir, cfg);

            Class<? extends Driver> driverClass = testLoader
                    .loadClass(cfg.getProperty("connection.driver_class")).asSubclass(Driver.class);
            Driver driver = driverClass.newInstance();
            WrappedDriver wd = new WrappedDriver(driver, cfg.getProperty("connection.driver_class"));

            boolean foundDriver = false;
            Enumeration<Driver> drivers = DriverManager.getDrivers();
            while (drivers.hasMoreElements()) {
                Driver nextDriver = (Driver) drivers.nextElement();
                if (nextDriver.getClass() == wd.getClass()) {
                    if (nextDriver.toString().equals(wd.toString())) {
                        foundDriver = true;
                        break;
                    }
                }
            }
            if (!foundDriver) {

                DriverManager.registerDriver(wd);
            }

            sessionFactory = cfg.buildSessionFactory();
            //configuration = cfg;
            HibernateMapDirectory = mapdir;
            HibernateConfigFile = hibfile;
        } catch (Throwable e) {
            e.printStackTrace();
            throw new HibernateException("No Session Factory Created " + e.getLocalizedMessage(), e);
        } finally {
            thread.setContextClassLoader(oldloader);
        }
    }
}

From source file:com.aalto.controllers.ProjectController.java

@RequestMapping(value = "/removeProject", method = RequestMethod.POST)
public Long removeProject(@RequestParam Map<String, String> reqParams) {
    logger.log(Level.INFO, "log: ProjectController removeProject !!");

    String pidString = (String) reqParams.get("pid");
    Long pid = Long.valueOf(pidString);
    Long projects = this.projectRepo.delete(pid);

    return projects;
}

From source file:com.plan.proyecto.servicios.gestionContenidos.gestionContenidosImplsTest.java

/**
 * Test of publicarContenido method, of class gestionContenidosImpls.
 *///from   w  w  w .j  a  va2 s .  com
@Test
public void testPublicarContenido() {
    log.log(Level.INFO, "Publicar Contenidos");
    log.log(Level.INFO, "Prueba de publicacin de contenidos");

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

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

    Contenido mensaje = new Mensaje("Texto prueba");

    mensaje = gestionContenidos.publicarContenido(cuenta, mensaje, null);

    assertNotNull(mensaje.getId());
    log.log(Level.INFO, "Prueba de insercin de un mensaje, terminada");

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

    Cuenta cuenta2 = new Cuenta(email, password, nombre, fecha);
    gestionCuentas.AltaCuenta(cuenta2);

    Contenido comentario = new Comentario("comentario prueba");

    comentario = gestionContenidos.publicarContenido(cuenta2, mensaje, comentario);

    assertNotNull(comentario.getId());
    log.log(Level.INFO, "Prueba de insercin de un comentario, terminada");
}

From source file:com.kopaid.example.wildfly.spring.security.UserDetailsServiceImpl.java

@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
    if (!users.containsKey(username)) {
        LOG.log(Level.INFO, "user with username '{0}' not found", username);
        throw new UsernameNotFoundException(Objects.toString(username) + "not found");
    }/*from   w  ww .j av a 2 s  .c o m*/
    LOG.log(Level.INFO, "user with username '{0}' found", username);
    return users.get(username);
}

From source file:net.chrissearle.flickrvote.flickr.impl.FlickrJCommentDAO.java

public void postComment(String imageId, String comment) {
    if (logger.isLoggable(Level.FINE)) {
        logger.fine("Posting comment check: " + commentsActiveFlag);
    }//from w  ww  .  ja va2 s . c o  m

    if (commentsActiveFlag) {
        if (logger.isLoggable(Level.INFO)) {
            logger.info("Image commented: " + imageId);

            if (logger.isLoggable(Level.FINE)) {
                logger.fine("Commenting on : " + imageId + " with comment: " + comment);
            }
        }

        comment(imageId, comment);
    }

}

From source file:com.adr.taskexecutor.ui.TaskExecutorRemote.java

/** Creates new form TaskExecutorRemote */
public TaskExecutorRemote() {
    initComponents();//from w  w w .j  a v a2 s.  co m

    jLoggingLevel.addItem(Level.SEVERE);
    jLoggingLevel.addItem(Level.WARNING);
    jLoggingLevel.addItem(Level.INFO);
    jLoggingLevel.addItem(Level.CONFIG);
    jLoggingLevel.addItem(Level.FINE);
    jLoggingLevel.addItem(Level.FINER);
    jLoggingLevel.addItem(Level.FINEST);
    jLoggingLevel.addItem(Level.OFF);
    jLoggingLevel.addItem(Level.ALL);

    jURL.setText(Configuration.getInstance().getPreference("remote.serverurl",
            "http://localhost/taskexecutoree/executetask"));
    jLoggingLevel.setSelectedItem(Level
            .parse(Configuration.getInstance().getPreference("remote.logginglevel", Level.INFO.toString())));
    jTrace.setSelected(Boolean
            .parseBoolean(Configuration.getInstance().getPreference("remote.trace", Boolean.FALSE.toString())));
    jStats.setSelected(Boolean
            .parseBoolean(Configuration.getInstance().getPreference("remote.stats", Boolean.TRUE.toString())));
}

From source file:com.skcraft.launcher.persistence.Persistence.java

/**
 * Read an object from a byte source, without binding it.
 *
 * @param source byte source//  w ww .  j  a v a 2  s  . c om
 * @param cls the class
 * @param returnNull true to return null if the object could not be loaded
 * @param <V> the type of class
 * @return an object
 */
public static <V> V read(ByteSource source, Class<V> cls, boolean returnNull) {
    V object;
    Closer closer = Closer.create();

    try {
        object = mapper.readValue(closer.register(source.openBufferedStream()), cls);
    } catch (IOException e) {
        if (!(e instanceof FileNotFoundException)) {
            log.log(Level.INFO, "Failed to load" + cls.getCanonicalName(), e);
        }

        if (returnNull) {
            return null;
        }

        try {
            object = cls.newInstance();
        } catch (InstantiationException e1) {
            throw new RuntimeException("Failed to construct object with no-arg constructor", e1);
        } catch (IllegalAccessException e1) {
            throw new RuntimeException("Failed to construct object with no-arg constructor", e1);
        }
    } finally {
        try {
            closer.close();
        } catch (IOException e) {
        }
    }

    return object;
}

From source file:com.microsoftopentechnologies.windowsazurestorage.helper.CredentialMigration.java

private static File backupFile(String sourceFile) throws IOException {
    String backupFile = sourceFile + ".backup";
    LOGGER.log(Level.INFO, sourceFile + ".backup has been created for backup.");
    File backUp = new File(backupFile);
    FileUtils.copyFile(new File(sourceFile), backUp);
    return backUp;
}