# HG changeset patch # User Mike Becker # Date 1512918614 -3600 # Node ID 2dfdb79b53443b0c1b9309910c3133b3bd986454 # Parent 598670d5b0b891fe3fb1fa998c9e5fec48a221e8 adds slf4j to project as netbeans library (make sure to have it configured in your environment) diff -r 598670d5b0b8 -r 2dfdb79b5344 nbproject/build-impl.xml --- a/nbproject/build-impl.xml Tue Nov 28 18:59:13 2017 +0100 +++ b/nbproject/build-impl.xml Sun Dec 10 16:10:14 2017 +0100 @@ -998,11 +998,13 @@ + + diff -r 598670d5b0b8 -r 2dfdb79b5344 nbproject/genfiles.properties --- a/nbproject/genfiles.properties Tue Nov 28 18:59:13 2017 +0100 +++ b/nbproject/genfiles.properties Sun Dec 10 16:10:14 2017 +0100 @@ -1,8 +1,8 @@ -build.xml.data.CRC32=2ce92825 +build.xml.data.CRC32=343ad249 build.xml.script.CRC32=1f023e98 build.xml.stylesheet.CRC32=651128d4@1.77.1.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=2ce92825 -nbproject/build-impl.xml.script.CRC32=db357bfe +nbproject/build-impl.xml.data.CRC32=343ad249 +nbproject/build-impl.xml.script.CRC32=36eb4694 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 diff -r 598670d5b0b8 -r 2dfdb79b5344 nbproject/project.properties --- a/nbproject/project.properties Tue Nov 28 18:59:13 2017 +0100 +++ b/nbproject/project.properties Sun Dec 10 16:10:14 2017 +0100 @@ -37,7 +37,8 @@ j2ee.server.type=Tomcat jar.compress=false javac.classpath=\ - ${libs.jstl.classpath} + ${libs.jstl.classpath}:\ + ${libs.SLF4J-JDK.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true diff -r 598670d5b0b8 -r 2dfdb79b5344 nbproject/project.xml --- a/nbproject/project.xml Tue Nov 28 18:59:13 2017 +0100 +++ b/nbproject/project.xml Sun Dec 10 16:10:14 2017 +0100 @@ -10,6 +10,10 @@ ${libs.jstl.classpath} WEB-INF/lib + + ${libs.SLF4J-JDK.classpath} + WEB-INF/lib + diff -r 598670d5b0b8 -r 2dfdb79b5344 src/java/de/uapcore/lightpit/ModuleManager.java --- a/src/java/de/uapcore/lightpit/ModuleManager.java Tue Nov 28 18:59:13 2017 +0100 +++ b/src/java/de/uapcore/lightpit/ModuleManager.java Sun Dec 10 16:10:14 2017 +0100 @@ -28,13 +28,13 @@ */ package de.uapcore.lightpit; -import java.util.logging.Level; -import java.util.logging.Logger; import javax.servlet.Registration; import javax.servlet.ServletContext; import javax.servlet.ServletContextEvent; import javax.servlet.ServletContextListener; import javax.servlet.annotation.WebListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * Scans registered servlets for LightPIT modules. @@ -42,7 +42,7 @@ @WebListener public class ModuleManager implements ServletContextListener { - private static final Logger LOG = Logger.getLogger(ModuleManager.class.getName()); + private static final Logger LOG = LoggerFactory.getLogger(ModuleManager.class); /** * The attribute name in the servlet context under which an instance of this class can be found. @@ -74,29 +74,32 @@ final boolean lpmodule = scclass.isAnnotationPresent(LightPITModule.class); if (lpservlet && !lpmodule) { - LOG.log(Level.WARNING, - "Servlet is a LightPITServlet but is missing the module annotation: {0}", - reg.getClassName()); + LOG.warn( + "Servlet is a LightPITServlet but is missing the module annotation: {}", + reg.getClassName() + ); } else if (!lpservlet && lpmodule) { - LOG.log(Level.WARNING, - "Servlet is annotated as a LightPITModule but does not extend LightPITServlet: {0}", - reg.getClassName()); + LOG.warn( + "Servlet is annotated as a LightPITModule but does not extend LightPITServlet: {}", + reg.getClassName() + ); } return lpservlet && lpmodule; } catch (ClassNotFoundException ex) { - LOG.log(Level.SEVERE, - "Servlet registration refers to a class which cannot be found by the class loader: {0}", - reg.getClassName()); + LOG.error( + "Servlet registration refers to a class which cannot be found by the class loader: {}", + reg.getClassName() + ); return false; } } private void handleServletRegistration(String name, Registration reg) { if (isRegisteredAsModule(reg)) { - LOG.log(Level.CONFIG, "Module detected: {0}", name); + LOG.info("Module detected: {}", name); } else { - LOG.log(Level.FINE, "Servlet {0} is no module, skipping.", name); + LOG.debug("Servlet {} is no module, skipping.", name); } }