Author: gk
Date: Thu Nov 15 11:48:08 2018
New Revision: 1846641

URL: http://svn.apache.org/viewvc?rev=1846641&view=rev
Log:
- Update to log4j2, slf4j non optional (forwarding commons logging)
- remove commons-logging dependency
- keep configurable location
- proposal with optional applicationRoot handling
- add missing service in TurbineNonPersistentSchedulerServiceTest.properties

Added:
    turbine/core/trunk/conf/log4j2.xml   (with props)
    turbine/core/trunk/conf/test/log4j2.xml   (with props)
Removed:
    turbine/core/trunk/conf/Log4j.properties
    turbine/core/trunk/conf/log4j.xml
    turbine/core/trunk/conf/test/Log4j.properties
    turbine/core/trunk/conf/test/log4j.xml
Modified:
    turbine/core/trunk/conf/test/CompleteTurbineResources.properties
    turbine/core/trunk/conf/test/TemplateService.properties
    turbine/core/trunk/conf/test/TestFulcrumComponents.properties
    
turbine/core/trunk/conf/test/TurbineNonPersistentSchedulerServiceTest.properties
    turbine/core/trunk/conf/test/usersettings.properties
    turbine/core/trunk/pom.xml
    turbine/core/trunk/proposals/gk/log4j2/pom.xml
    
turbine/core/trunk/proposals/gk/log4j2/src/java/org/apache/turbine/Turbine.java
    turbine/core/trunk/src/changes/changes.xml
    turbine/core/trunk/src/java/org/apache/turbine/Turbine.java
    turbine/core/trunk/src/java/org/apache/turbine/TurbineConstants.java

Added: turbine/core/trunk/conf/log4j2.xml
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/log4j2.xml?rev=1846641&view=auto
==============================================================================
--- turbine/core/trunk/conf/log4j2.xml (added)
+++ turbine/core/trunk/conf/log4j2.xml Thu Nov 15 11:48:08 2018
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!-- 
+  File location: see https://logging.apache.org/log4j/2.x/manual/webapp.html 
+   ...If no location is defined Log4j will search for a file that starts with 
"log4j2" in the WEB-INF directory...
+   
+   Cf. https://logging.apache.org/log4j/2.x/manual/webapp.html
+   
+   web:rootDir see Web Lookup: 
https://logging.apache.org/log4j/2.x/manual/lookups.html
+-->
+<Configuration >
+    <Appenders>
+        <Console name="console" target="SYSTEM_OUT">
+             <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+           </Console>
+           <File name="avalon" fileName="${web:rootDir}/logs/avalon.log">
+             <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+           </File>
+            <File name="torque" fileName="${web:rootDir}/logs/torque.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+        </File>
+         <File name="turbine" fileName="${web:rootDir}/logs/turbine.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+        </File>
+          <File name="velocity" fileName="${web:rootDir}/logs/velocity.log">
+          <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+        </File>
+    </Appenders>
+    <Loggers>
+            <Logger name="avalon" level="info" additivity="false">
+             <AppenderRef ref="avalon"/>
+           </Logger>
+            <Logger name="org.apache.torque" level="info" additivity="false">
+          <AppenderRef ref="torque"/>
+        </Logger>
+         <Logger name="scheduler" level="info" additivity="false">
+          <AppenderRef ref="scheduler"/>
+        </Logger>
+         <Logger name="org.apache.turbine" level="info" additivity="false">
+          <AppenderRef ref="turbine"/>
+          <AppenderRef ref="console"/>
+        </Logger>
+           <Root level="info">
+             <AppenderRef ref="turbine"/>
+           </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file

Propchange: turbine/core/trunk/conf/log4j2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: turbine/core/trunk/conf/test/CompleteTurbineResources.properties
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/CompleteTurbineResources.properties?rev=1846641&r1=1846640&r2=1846641&view=diff
==============================================================================
--- turbine/core/trunk/conf/test/CompleteTurbineResources.properties (original)
+++ turbine/core/trunk/conf/test/CompleteTurbineResources.properties Thu Nov 15 
11:48:08 2018
@@ -19,11 +19,12 @@
 pipeline.default.descriptor = /conf/turbine-classic-pipeline.xml
 # -------------------------------------------------------------------
 #
-#  L O G 4 J - L O G G I N G
+#  L O G 4 J 2 - L O G G I N G
+#
+#  log4j2 may loads automatically if found on classpath, cf. 
https://logging.apache.org/log4j/2.x
 #
 # -------------------------------------------------------------------
-
-log4j.file = log4j.xml
+log4j2.file = log4j2.xml
 
 # -------------------------------------------------------------------
 #

Modified: turbine/core/trunk/conf/test/TemplateService.properties
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/TemplateService.properties?rev=1846641&r1=1846640&r2=1846641&view=diff
==============================================================================
--- turbine/core/trunk/conf/test/TemplateService.properties (original)
+++ turbine/core/trunk/conf/test/TemplateService.properties Thu Nov 15 11:48:08 
2018
@@ -15,10 +15,13 @@
 # specific language governing permissions and limitations
 # under the License.
 
-log4j.file = log4j.xml
-#log4j.file = none
+# log4j2 may loads automatically if found on classpath, cf. 
https://logging.apache.org/log4j/2.x
+log4j2.file = log4j2.xml
+#log4j2.file = none
+
 # or resolve relatively e.g. 
-#log4j.file = ../../conf/Log4j.properties
+#log4j2.file = ../../conf/Log4j.properties
+
 pipeline.default.descriptor = conf/turbine-classic-pipeline.xml
 module.cache=false
 

Modified: turbine/core/trunk/conf/test/TestFulcrumComponents.properties
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/TestFulcrumComponents.properties?rev=1846641&r1=1846640&r2=1846641&view=diff
==============================================================================
--- turbine/core/trunk/conf/test/TestFulcrumComponents.properties (original)
+++ turbine/core/trunk/conf/test/TestFulcrumComponents.properties Thu Nov 15 
11:48:08 2018
@@ -17,11 +17,12 @@
 
 # -------------------------------------------------------------------
 #
-#  L O G 4 J - L O G G I N G
+#  L O G 4 J 2 - L O G G I N G
 #
 # -------------------------------------------------------------------
+# log4j2 may loads automatically if found on classpath, cf. 
https://logging.apache.org/log4j/2.x
+log4j2.file = log4j2.xml
 
-log4j.file = log4j.xml
 # context path: cft. javax.servlet.ServletContext.getResource(String)
 pipeline.default.descriptor = conf/turbine-classic-pipeline.xml
 

Modified: 
turbine/core/trunk/conf/test/TurbineNonPersistentSchedulerServiceTest.properties
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/TurbineNonPersistentSchedulerServiceTest.properties?rev=1846641&r1=1846640&r2=1846641&view=diff
==============================================================================
--- 
turbine/core/trunk/conf/test/TurbineNonPersistentSchedulerServiceTest.properties
 (original)
+++ 
turbine/core/trunk/conf/test/TurbineNonPersistentSchedulerServiceTest.properties
 Thu Nov 15 11:48:08 2018
@@ -17,11 +17,11 @@
 
 # -------------------------------------------------------------------
 #
-#  L O G 4 J - L O G G I N G
+#  L O G 4 J 2 - L O G G I N G
 #
 # -------------------------------------------------------------------
-
-log4j.file = log4j.xml
+# log4j2 may loads automatically if found on classpath, cf. 
https://logging.apache.org/log4j/2.x
+log4j2.file = log4j2.xml
 
 # resource relative to context
 pipeline.default.descriptor = /conf/turbine-classic-pipeline.xml
@@ -69,6 +69,8 @@ services.RunDataService.classname=org.ap
 
services.AssemblerBrokerService.classname=org.apache.turbine.services.assemblerbroker.TurbineAssemblerBrokerService
 
services.SchedulerService.classname=org.apache.turbine.services.schedule.TurbineNonPersistentSchedulerService
 
services.TemplateService.classname=org.apache.turbine.services.template.TurbineTemplateService
+# required by template service
+services.ServletService.classname=org.apache.turbine.services.servlet.TurbineServletService
 
 # -------------------------------------------------------------------
 #

Added: turbine/core/trunk/conf/test/log4j2.xml
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/log4j2.xml?rev=1846641&view=auto
==============================================================================
--- turbine/core/trunk/conf/test/log4j2.xml (added)
+++ turbine/core/trunk/conf/test/log4j2.xml Thu Nov 15 11:48:08 2018
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<Configuration status="trace" verbose="true">
+    <Appenders>
+        <Console name="console" target="SYSTEM_OUT">
+             <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+           </Console>
+           <File name="logfile" fileName="target/turbine-test.log">
+             <PatternLayout pattern="%d [%t] %-5p %c - %m%n"/>
+           </File>
+    </Appenders>
+    <Loggers>
+         <Logger name="org.apache.turbine" level="debug" additivity="false">
+          <AppenderRef ref="logfile"/>
+        </Logger>
+        <Logger name="avalon" level="info" additivity="false">
+             <AppenderRef ref="logfile"/>
+           </Logger>
+      <Logger name="org.apache.logging.log4j" level="debug" additivity="false">
+             <AppenderRef ref="logfile"/>
+           </Logger>
+           <Root level="error">
+             <AppenderRef ref="logfile"/>
+           </Root>
+    </Loggers>
+</Configuration>
\ No newline at end of file

Propchange: turbine/core/trunk/conf/test/log4j2.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: turbine/core/trunk/conf/test/usersettings.properties
URL: 
http://svn.apache.org/viewvc/turbine/core/trunk/conf/test/usersettings.properties?rev=1846641&r1=1846640&r2=1846641&view=diff
==============================================================================
--- turbine/core/trunk/conf/test/usersettings.properties (original)
+++ turbine/core/trunk/conf/test/usersettings.properties Thu Nov 15 11:48:08 
2018
@@ -1,4 +1,5 @@
-log4j.file = log4j.xml
+log4j2.file = log4j2.xml
+#log4j2.file = none
 # or resolve relatively 
 #log4j.file = ../../conf/Log4j.properties
 module.cache=false


Reply via email to