[vlma-devel] commit: Add logging to the web module. (Adrien Grand )

git version control git at videolan.org
Tue Apr 29 18:34:16 CEST 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Tue Apr 29 17:44:56 2008 +0200| [d38b8cb32ba885543c7b5b89515e5c073f6f596d]

Add logging to the web module.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=d38b8cb32ba885543c7b5b89515e5c073f6f596d
---

 web/src/main/webapp/WEB-INF/log4j.xml |   14 ++++++++++++++
 web/src/main/webapp/WEB-INF/web.xml   |   11 +++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/web/src/main/webapp/WEB-INF/log4j.xml b/web/src/main/webapp/WEB-INF/log4j.xml
new file mode 100644
index 0000000..c9edb41
--- /dev/null
+++ b/web/src/main/webapp/WEB-INF/log4j.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+    <appender name="console" class="org.apache.log4j.ConsoleAppender">
+        <param name="threshold" value="DEBUG" />
+        <layout class="org.apache.log4j.SimpleLayout" />
+    </appender>
+    <root>
+        <level value="INFO" />
+        <appender-ref ref="console" />
+    </root>
+</log4j:configuration>
diff --git a/web/src/main/webapp/WEB-INF/web.xml b/web/src/main/webapp/WEB-INF/web.xml
index 95c2174..1a806cb 100644
--- a/web/src/main/webapp/WEB-INF/web.xml
+++ b/web/src/main/webapp/WEB-INF/web.xml
@@ -13,6 +13,11 @@
         </param-value>
     </context-param>
 
+    <context-param>
+        <param-name>log4jConfigLocation</param-name>
+        <param-value>/WEB-INF/log4j.xml</param-value>
+    </context-param>
+
     <listener>
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
     </listener>
@@ -31,6 +36,12 @@
     </servlet-mapping>
 
     <servlet>
+        <servlet-name>log4j</servlet-name>
+        <servlet-class>org.springframework.web.util.Log4jConfigServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet>
         <servlet-name>RrdGraphServlet</servlet-name>
         <servlet-class>org.videolan.vlma.web.servlet.RrdGraphServlet</servlet-class>
     </servlet>



More information about the vlma-devel mailing list