Skip to content

Commit

Permalink
feat: replacing log4j by logback
Browse files Browse the repository at this point in the history
  • Loading branch information
jgribonvald committed Oct 18, 2022
1 parent 56155e1 commit e80eae3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 83 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
<project.build.source>1.8</project.build.source>
<project.build.target>1.8</project.build.target>
<uportal-libs.version>5.12.0</uportal-libs.version>
<logback.version>1.2.11</logback.version>
</properties>

<scm>
Expand Down Expand Up @@ -187,6 +188,12 @@
<version>2.3.9</version>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>

<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,15 @@

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

@Service("basketSession")
@Scope("session")
public class BasketSession {

protected static final Log log = LogFactory.getLog(BasketSession.class);

private List<String> dirsToCopy;

private String goal;

public List<String> getDirsToCopy() {
Expand All @@ -49,5 +45,5 @@ public String getGoal() {
public void setGoal(String goal) {
this.goal = goal;
}

}
13 changes: 13 additions & 0 deletions src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
</layout>
</appender>

<root level="debug">
<appender-ref ref="STDOUT" />
</root>
</configuration>
51 changes: 0 additions & 51 deletions src/main/webapp/WEB-INF/log4j.properties

This file was deleted.

38 changes: 12 additions & 26 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,47 +18,35 @@
limitations under the License.
-->
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_3_0.xsd">

<display-name>esup-filemanager</display-name>

<context-param>
<param-name>webAppRootKey</param-name>
<param-value>esup-filemanager</param-value>
</context-param>
<context-param>
<param-name>log4jExposeWebAppRoot</param-name>
<param-value>false</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>


<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/context/applicationContext.xml</param-value>
</context-param>

<context-param>
<param-name>defaultHtmlEscape</param-name>
<param-value>false</param-value>
</context-param>
</context-param>

<!--
| The order of these listeners is important and should not be changed
+-->
<listener>
<listener-class>org.springframework.web.util.WebAppRootListener</listener-class>
</listener>

<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>


<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Expand All @@ -81,8 +69,7 @@
<url-pattern>/CasProxyServlet</url-pattern>
</filter-mapping>


<!--
<!--
| This servlet is needed by the spring DispatcherPortlet for rendering.
+-->
<servlet>
Expand All @@ -91,12 +78,11 @@
<load-on-startup>1</load-on-startup>
</servlet>


<!-- [INSERT JSPC FRAGMENT HERE] -->

<servlet-mapping>
<servlet-name>ViewRendererServlet</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>

</web-app>

0 comments on commit e80eae3

Please sign in to comment.