# HG changeset patch # User Mike Becker # Date 1514312312 -3600 # Node ID 2b270c714678dc3b2aa52c1163b73036e14ce6db # Parent f4608ad6c947e25f532cc2a35f149a7114a0b53f changed logger implementation to log4j2 diff -r f4608ad6c947 -r 2b270c714678 nbproject/build-impl.xml --- a/nbproject/build-impl.xml Tue Dec 26 17:36:47 2017 +0100 +++ b/nbproject/build-impl.xml Tue Dec 26 19:18:32 2017 +0100 @@ -998,13 +998,15 @@ - + + - + + diff -r f4608ad6c947 -r 2b270c714678 nbproject/genfiles.properties --- a/nbproject/genfiles.properties Tue Dec 26 17:36:47 2017 +0100 +++ b/nbproject/genfiles.properties Tue Dec 26 19:18:32 2017 +0100 @@ -1,8 +1,8 @@ -build.xml.data.CRC32=343ad249 +build.xml.data.CRC32=40807f5e 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=343ad249 -nbproject/build-impl.xml.script.CRC32=36eb4694 +nbproject/build-impl.xml.data.CRC32=40807f5e +nbproject/build-impl.xml.script.CRC32=0c71c5d8 nbproject/build-impl.xml.stylesheet.CRC32=99ea4b56@1.77.1.1 diff -r f4608ad6c947 -r 2b270c714678 nbproject/project.properties --- a/nbproject/project.properties Tue Dec 26 17:36:47 2017 +0100 +++ b/nbproject/project.properties Tue Dec 26 19:18:32 2017 +0100 @@ -38,7 +38,8 @@ jar.compress=false javac.classpath=\ ${libs.jstl.classpath}:\ - ${libs.SLF4J-JDK.classpath} + ${libs.SLF4J-LOG4J2.classpath}:\ + ${libs.LOG4J2-WEB.classpath} # Space-separated list of extra javac options javac.compilerargs= javac.debug=true diff -r f4608ad6c947 -r 2b270c714678 nbproject/project.xml --- a/nbproject/project.xml Tue Dec 26 17:36:47 2017 +0100 +++ b/nbproject/project.xml Tue Dec 26 19:18:32 2017 +0100 @@ -11,7 +11,11 @@ WEB-INF/lib - ${libs.SLF4J-JDK.classpath} + ${libs.SLF4J-LOG4J2.classpath} + WEB-INF/lib + + + ${libs.LOG4J2-WEB.classpath} WEB-INF/lib diff -r f4608ad6c947 -r 2b270c714678 src/java/de/uapcore/lightpit/AbstractLightPITServlet.java --- a/src/java/de/uapcore/lightpit/AbstractLightPITServlet.java Tue Dec 26 17:36:47 2017 +0100 +++ b/src/java/de/uapcore/lightpit/AbstractLightPITServlet.java Tue Dec 26 19:18:32 2017 +0100 @@ -87,7 +87,7 @@ private ResponseType invokeMapping(Method method, HttpServletRequest req, HttpServletResponse resp) throws IOException, ServletException { try { - LOG.debug("invoke {}", method.getName()); + LOG.trace("invoke {}#{}", method.getDeclaringClass().getName(), method.getName()); return (ResponseType) method.invoke(this, req, resp); } catch (ReflectiveOperationException | ClassCastException ex) { LOG.error(String.format("invocation of method %s failed", method.getName()), ex); @@ -242,6 +242,8 @@ Locale sessionLocale = reqLocale.filter((rl) -> availableLanguages.map((al) -> al.contains(rl.getLanguage())).orElse(false)).orElse(Locale.ENGLISH); session.setAttribute(Constants.SESSION_ATTR_LANGUAGE, sessionLocale); LOG.debug("Settng language for new session {}: {}", session.getId(), sessionLocale.getDisplayLanguage()); + } else { + LOG.trace("Continuing session {} with language {}", session.getId(), session.getAttribute(Constants.SESSION_ATTR_LANGUAGE)); } req.setAttribute(Constants.REQ_ATTR_PATH, Functions.fullPath(req)); diff -r f4608ad6c947 -r 2b270c714678 src/java/de/uapcore/lightpit/modules/LanguageModule.java --- a/src/java/de/uapcore/lightpit/modules/LanguageModule.java Tue Dec 26 17:36:47 2017 +0100 +++ b/src/java/de/uapcore/lightpit/modules/LanguageModule.java Tue Dec 26 19:18:32 2017 +0100 @@ -30,7 +30,6 @@ import de.uapcore.lightpit.LightPITModule; import de.uapcore.lightpit.AbstractLightPITServlet; -import de.uapcore.lightpit.Constants; import de.uapcore.lightpit.Functions; import de.uapcore.lightpit.HttpMethod; import javax.servlet.annotation.WebServlet; diff -r f4608ad6c947 -r 2b270c714678 src/java/log4j2.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/java/log4j2.properties Tue Dec 26 19:18:32 2017 +0100 @@ -0,0 +1,36 @@ +# Copyright 2017 Mike Becker. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +status = warn +dest = err +name = PropertiesConfig + +appender.console.type = Console +appender.console.name = STDOUT +appender.console.layout.type = PatternLayout +appender.console.layout.pattern = %d{ISO8601} %p - %M: %m %n + +rootLogger.appenderRef.stdout.ref = STDOUT + +rootLogger.level = debug diff -r f4608ad6c947 -r 2b270c714678 src/java/logging.properties --- a/src/java/logging.properties Tue Dec 26 17:36:47 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -# Copyright 2017 Mike Becker. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -handlers= java.util.logging.ConsoleHandler - -.level = DEBUG