Skip to content

Commit

Permalink
SAK-31664 update velocity framework to use SLF4JLogChute (sakaiprojec…
Browse files Browse the repository at this point in the history
  • Loading branch information
ern authored Nov 22, 2016
1 parent 7f129d3 commit 99d93b5
Show file tree
Hide file tree
Showing 49 changed files with 326 additions and 247 deletions.
13 changes: 5 additions & 8 deletions access/access-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.access

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
14 changes: 5 additions & 9 deletions access/web-tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
##runtime.log.logsystem.log4j.category = vm.info
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.web

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
13 changes: 5 additions & 8 deletions alias/alias-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.alias.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.announcement.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
13 changes: 5 additions & 8 deletions archive/archive-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.info.toolname
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.archive.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
13 changes: 5 additions & 8 deletions assignment/assignment-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.assignment.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
13 changes: 5 additions & 8 deletions authz/authz-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.authz.helper.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
13 changes: 5 additions & 8 deletions basiclti/basiclti-tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.velocity.sample

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
4 changes: 4 additions & 0 deletions basiclti/web-ifp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
<artifactId>velocity</artifactId>
<version>${sakai.velocity.version}</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.velocity</groupId>
<artifactId>sakai-velocity-util</artifactId>
</dependency>
<dependency>
<groupId>logkit</groupId>
<artifactId>logkit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.app.VelocityEngine;

import org.sakaiproject.velocity.util.SLF4JLogChute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -32,9 +33,7 @@ public static VelocityEngine makeEngine(PortletContext pContext)
org.apache.velocity.exception.ParseErrorException, java.lang.Exception
{
VelocityEngine vengine = new VelocityEngine();
vengine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS,
"org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
vengine.setProperty("runtime.log.logsystem.log4j.category", "ve.portal");
vengine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, new SLF4JLogChute());
Properties p = new Properties();
String webappRegPath = "/WEB-INF/velocity.config";
InputStream is = pContext.getResourceAsStream(webappRegPath);
Expand Down Expand Up @@ -106,8 +105,7 @@ public static boolean doTemplate(VelocityEngine vengine, String vTemplate,
"class.resource.loader.modificationCheckInterval=0\n" +
"input.encoding=UTF-8\n" +
"output.encoding=UTF-8\n" +
"runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem\n" +
"runtime.log.logsystem.log4j.category=vm.none\n" +
"runtime.log.logsystem.class=org.sakaiproject.velocity.util.SLF4JLogChute\n" +
"velocimacro.permissions.allow.inline=true\n" +
"velocimacro.permissions.allow.inline.override=true\n" ;

Expand Down
5 changes: 2 additions & 3 deletions basiclti/web-ifp/src/webapp/WEB-INF/velocity.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class.resource.loader.modificationCheckInterval=0
input.encoding=UTF-8
output.encoding=UTF-8

runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
runtime.log.logsystem.log4j.category=vm.none

runtime.log.logsystem.class=org.sakaiproject.velocity.util.SLF4JLogChute
# runtime.log.logsystem.slf4j.logger =
#
# Velocity macro properties
#
Expand Down
13 changes: 5 additions & 8 deletions calendar/calendar-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.calendar.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@
# default LogSystem to use: default: AvalonLogSystem
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.citation.servlet

#---------------------------------------------------------------------------
# This is the location of the Velocity Runtime log.
Expand Down
13 changes: 5 additions & 8 deletions citations/citations-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.citation.tools

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
13 changes: 5 additions & 8 deletions content/content-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.content.tools

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
8 changes: 1 addition & 7 deletions kernel/kernel-common/src/main/config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ log4j.logger.org.sakaiproject=INFO
log4j.logger.uk.ac.cam.caret.rwiki=INFO
log4j.logger.org.theospi=INFO
log4j.logger.MySQL=INFO
log4j.logger.velocity=INFO
#log4j.logger.com.zaxxer.hikari=DEBUG
#log4j.logger.org.springframework=DEBUG

Expand All @@ -44,10 +45,3 @@ log4j.logger.org.apache.myfaces.shared_tomahawk.webapp.webxml.WebXmlParser=ERROR

# Ignore Dandelion Datatables warnings
log4j.logger.com.github.dandelion.datatables.thymeleaf.processor.el.TdElProcessor=ERROR

# Setup vm levels
log4j.logger.vm.none=FATAL
log4j.logger.vm.error=ERROR
log4j.logger.vm.warn=WARN
log4j.logger.vm.info=INFO
log4j.logger.vm.debug=DEBUG
4 changes: 4 additions & 0 deletions login/login-render-engine-impl/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<artifactId>velocity-tools</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.velocity</groupId>
<artifactId>sakai-velocity-util</artifactId>
</dependency>
</dependencies>
<build>
<resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ class.resource.loader.modificationCheckInterval=0
input.encoding=UTF-8
output.encoding=UTF-8

runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
# runtime.log.logsystem.log4j.category=portal.vm
runtime.log.logsystem.log4j.category=vm.none


runtime.log.logsystem.class=org.sakaiproject.velocity.util.SLF4JLogChute
# runtime.log.logsystem.slf4j.logger = velocity.login
#
# Velocity macro properties
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.sakaiproject.velocity.util.SLF4JLogChute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.velocity.app.VelocityEngine;
Expand Down Expand Up @@ -73,9 +74,8 @@ public void init() throws Exception {

vengine.setApplicationAttribute(ServletContext.class.getName(), context);

vengine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, "org.apache.velocity.runtime.log.SimpleLog4JLogSystem");
vengine.setProperty("runtime.log.logsystem.log4j.category", "ve.login");

vengine.setProperty(RuntimeConstants.RUNTIME_LOG_LOGSYSTEM_CLASS, new SLF4JLogChute());

Properties p = new Properties();
InputStream in = this.getClass().getResourceAsStream(loginConfig);
if ( in == null ) {
Expand Down
13 changes: 5 additions & 8 deletions mailarchive/mailarchive-tool/tool/src/webapp/velocity.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@
# R U N T I M E L O G
#----------------------------------------------------------------------------

# log to our existing log4j
runtime.log.logsystem.class = org.apache.velocity.runtime.log.SimpleLog4JLogSystem

# use vm.info.toolname to get info and up messages
# use vm.warn.toolname to get warn and up messages
# use vm.error.toolname to get only error messages
# use vm.none to get no messages
runtime.log.logsystem.log4j.category = vm.none
# log to our existing slf4j
runtime.log.logsystem.class = org.sakaiproject.velocity.util.SLF4JLogChute

# default logger can be overridden
# runtime.log.logsystem.slf4j.logger = velocity.sakai.mailarchive.tool

# use this for no logging
#runtime.log.logsystem.class = org.apache.velocity.runtime.log.NullLogSystem
Expand Down
5 changes: 5 additions & 0 deletions master/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,11 @@
<version>${sakai.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.sakaiproject.velocity</groupId>
<artifactId>sakai-velocity-util</artifactId>
<version>${sakai.version}</version>
</dependency>
<dependency>
<groupId>org.sakaiproject.oauth</groupId>
<artifactId>oauth-api</artifactId>
Expand Down
Loading

0 comments on commit 99d93b5

Please sign in to comment.