Skip to content

Commit 921eac8

Browse files
author
冯周
committed
add log cofig
1 parent 89451d1 commit 921eac8

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

spitter-web/pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@
148148
<version>1.9.13</version>
149149
</dependency>
150150

151+
<dependency>
152+
<groupId>log4j</groupId>
153+
<artifactId>log4j</artifactId>
154+
<version>1.2.12</version>
155+
</dependency>
156+
151157
<dependency>
152158
<groupId>junit</groupId>
153159
<artifactId>junit</artifactId>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### set log levels - for more verbose logging change 'info' to 'debug' ###
2+
log4j.rootLogger =info, stdout
3+
4+
### direct log messages to stdout ###
5+
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
6+
log4j.appender.stdout.Target=System.out
7+
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
8+
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %5p %c{1}:%L - %m%n
9+
10+
11+

spitter-web/src/main/webapp/WEB-INF/web.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
<url-pattern>/</url-pattern>
1717
</servlet-mapping>
1818

19+
<context-param>
20+
<param-name>log4jConfiguration</param-name>
21+
<param-value>classpath:log4j.properties</param-value>
22+
</context-param>
23+
<listener>
24+
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
25+
</listener>
26+
1927
<listener>
2028
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
2129
</listener>
@@ -27,4 +35,6 @@
2735
classpath:service-context.xml
2836
</param-value>
2937
</context-param>
38+
39+
3040
</web-app>

0 commit comments

Comments
 (0)