Code example for Logger

Methods: info, log

0
     */ 
    @Override 
    public void init() throws ServletException { 
        Stopwatchs.start("Discovering Request Processors"); 
        try { 
            LOGGER.info("Discovering request processors....");
            final String scanPath = getServletConfig().getInitParameter("scanPath");
 
            RequestProcessors.discover(scanPath);
            LOGGER.info("Discovered request processors");
        } catch (final Exception e) {
            LOGGER.log(Level.SEVERE, "Initializes request processors failed", e);
        } finally { 
            Stopwatchs.end(); 
        } 
 
        final ServletContext servletContext = getServletContext();
 
        if (servletContext.getNamedDispatcher(COMMON_DEFAULT_SERVLET_NAME) != null) {
            defaultServletName = COMMON_DEFAULT_SERVLET_NAME;
        } else if (servletContext.getNamedDispatcher(GAE_DEFAULT_SERVLET_NAME) != null) {
            defaultServletName = GAE_DEFAULT_SERVLET_NAME;
        } else if (servletContext.getNamedDispatcher(RESIN_DEFAULT_SERVLET_NAME) != null) {
            defaultServletName = RESIN_DEFAULT_SERVLET_NAME;
        } else if (servletContext.getNamedDispatcher(WEBLOGIC_DEFAULT_SERVLET_NAME) != null) {
            defaultServletName = WEBLOGIC_DEFAULT_SERVLET_NAME;
        } else if (servletContext.getNamedDispatcher(WEBSPHERE_DEFAULT_SERVLET_NAME) != null) {
            defaultServletName = WEBSPHERE_DEFAULT_SERVLET_NAME;
        } else { 
            throw new IllegalStateException(
                "Unable to locate the default servlet for serving static content. " 
                    + "Please set the 'defaultServletName' property explicitly."); 
            // TODO: Loads from local.properties 
        } 
 
        LOGGER.log(Level.CONFIG, "The default servlet for serving static resource is [{0}]", defaultServletName);
    } 
 
    /** 
     * Serves. 
     *