jiapeng 7 years ago
parent
commit
42b29ccc62

+ 1 - 0
pom.xml

@ -190,6 +190,7 @@
190 190
					<include>project-dev.properties</include>
191 191
					<include>project-test-dev.properties</include>
192 192
					<include>project-test.properties</include>
193
					<include>META-INF/**/*</include>
193 194
				</includes>
194 195
				<filtering>true</filtering>
195 196
			</resource>

+ 3 - 2
src/main/java/com/ekexiu/portal/job/ArticleTaskJobEntry.java

@ -7,9 +7,10 @@ import java.util.List;
7 7

8 8
import javax.sql.DataSource;
9 9

10
import org.apache.log4j.Logger;
11 10
import org.jfw.apt.annotation.Autowrie;
12 11
import org.jfw.apt.annotation.Bean;
12
import org.jfw.util.log.LogFactory;
13
import org.jfw.util.log.Logger;
13 14

14 15
import com.ekexiu.portal.dao.ArticleDao;
15 16
import com.ekexiu.portal.po.Article;
@ -17,7 +18,7 @@ import com.ekexiu.portal.service.ArticleService;
17 18

18 19
@Bean
19 20
public class ArticleTaskJobEntry implements Runnable {
20
	private static Logger logger = Logger.getLogger(ArticleTaskJobEntry.class);
21
	private static Logger logger = LogFactory.getLog(ArticleTaskJobEntry.class);
21 22
	private long delayTime = 10 * 60;
22 23
	private String dateFormat = "yyyyMMddHHmmss";
23 24
	@Autowrie("dataSource")

+ 3 - 2
src/main/java/com/ekexiu/portal/job/ProScoreTaskJobEntry.java

@ -6,15 +6,16 @@ import java.util.Date;
6 6

7 7
import javax.sql.DataSource;
8 8

9
import org.apache.log4j.Logger;
10 9
import org.jfw.apt.annotation.Autowrie;
11 10
import org.jfw.apt.annotation.Bean;
11
import org.jfw.util.log.LogFactory;
12
import org.jfw.util.log.Logger;
12 13

13 14
import com.ekexiu.portal.service.ProfessorService;
14 15

15 16
@Bean
16 17
public class ProScoreTaskJobEntry implements Runnable {
17
	private static Logger logger = Logger.getLogger(ProScoreTaskJobEntry.class);
18
	private static Logger logger = LogFactory.getLog(ProScoreTaskJobEntry.class);
18 19
	private String taskTime;
19 20
	private long delayTime;
20 21
	@Autowrie("dataSource")

+ 3 - 2
src/main/java/com/ekexiu/portal/job/TaskJobEntry.java

@ -6,14 +6,15 @@ import java.util.Date;
6 6

7 7
import javax.sql.DataSource;
8 8

9
import org.apache.log4j.Logger;
10 9
import org.jfw.apt.annotation.Autowrie;
11 10
import org.jfw.apt.annotation.Bean;
11
import org.jfw.util.log.LogFactory;
12
import org.jfw.util.log.Logger;
12 13

13 14
import com.ekexiu.portal.service.ProfessorService;
14 15
@Bean
15 16
public class TaskJobEntry implements Runnable{
16
	private static Logger logger = Logger.getLogger(TaskJobEntry.class);
17
	private static Logger logger = LogFactory.getLog(TaskJobEntry.class);
17 18
	private String taskTime;
18 19
	private long delayTime;
19 20
	@Autowrie("dataSource")

+ 3 - 2
src/main/java/com/ekexiu/portal/service/SysService.java

@ -12,7 +12,6 @@ import java.util.concurrent.TimeUnit;
12 12
13 13
import javax.mail.MessagingException;
14 14
15
import org.apache.log4j.Logger;
16 15
import org.jfw.apt.annotation.Autowrie;
17 16
import org.jfw.apt.annotation.DefaultValue;
18 17
import org.jfw.apt.annotation.Nullable;
@ -26,6 +25,8 @@ import org.jfw.apt.web.annotation.param.SessionVal;
26 25
import org.jfw.util.StringUtil;
27 26
import org.jfw.util.context.JfwAppContext;
28 27
import org.jfw.util.exception.JfwBaseException;
28
import org.jfw.util.log.LogFactory;
29
import org.jfw.util.log.Logger;
29 30
import org.jfw.util.state.StateCode;
30 31
31 32
import com.ekexiu.portal.dao.OrgDao;
@ -50,7 +51,7 @@ import com.ekexiu.portal.pojo.SessionUser;
50 51
public class SysService {
51 52
	public static final String DEFAULT_PASS_WORD = "11111111111111111111111111111111";
52 53
	public static SimpleDateFormat DATE = new SimpleDateFormat("yyyyMMddHHmmss");
53
	private Logger logger = Logger.getLogger(SysService.class);
54
	private Logger logger = LogFactory.getLog(SysService.class);
54 55
55 56
	@Autowrie
56 57
	private UserDao userDao;

+ 11 - 0
src/main/java/com/ekexiu/portal/util/Log4jLogFactory.java

@ -0,0 +1,11 @@
1
package com.ekexiu.portal.util;
2

3
import org.jfw.util.log.LogFactory;
4
import org.jfw.util.log.Logger;
5

6
public class Log4jLogFactory extends LogFactory {
7
	@Override
8
	public Logger getLogger(Class<?> clazz) {
9
		return new Log4jLogger(org.apache.log4j.Logger.getLogger(clazz));
10
	}
11
}

+ 93 - 0
src/main/java/com/ekexiu/portal/util/Log4jLogger.java

@ -0,0 +1,93 @@
1
package com.ekexiu.portal.util;
2

3
import org.jfw.util.log.Logger;
4

5
public class Log4jLogger implements Logger {
6
	
7
	private final org.apache.log4j.Logger log;
8
	
9
	 public Log4jLogger(org.apache.log4j.Logger log) {
10
		 this.log = log;
11
	 }
12

13
	@Override
14
	public boolean isEnableTrace() {
15
		return log.isTraceEnabled();
16
	}
17

18
	@Override
19
	public void trace(String message) {
20
		log.trace(message);
21
	}
22

23
	@Override
24
	public void trace(String message, Throwable t) {
25
		log.trace(message, t);
26
	}
27

28
	@Override
29
	public boolean isEnableDebug() {
30
		return log.isDebugEnabled();
31
	}
32

33
	@Override
34
	public void debug(String message) {
35
		log.debug(message);		
36
	}
37

38
	@Override
39
	public void debug(String message, Throwable t) {
40
		log.debug(message, t);
41
	}
42

43
	@Override
44
	public boolean isEnableInfo() {
45
		return log.isInfoEnabled();
46
	}
47

48
	@Override
49
	public void info(String message) {
50
		log.info(message);
51
	}
52

53
	@Override
54
	public void info(String message, Throwable t) {
55
		log.info(message, t);
56
	}
57

58
	@Override
59
	public boolean isEnableWarn() {
60
		return true;
61
	}
62

63
	@Override
64
	public void warn(String message) {
65
		log.warn(message);
66
	}
67

68
	@Override
69
	public void warn(String message, Throwable t) {
70
		log.warn(message, t);
71
	}
72

73
	@Override
74
	public void error(String message) {
75
		log.error(message);
76
	}
77

78
	@Override
79
	public void error(String message, Throwable t) {
80
		log.error(message, t);
81
	}
82

83
	@Override
84
	public void fatal(String message) {
85
		log.fatal(message);
86
	}
87

88
	@Override
89
	public void fatal(String message, Throwable t) {
90
		log.fatal(message, t);
91
	}
92

93
}

+ 3 - 1
src/main/java/com/ekexiu/push/service/PushService.java

@ -27,6 +27,8 @@ import org.jfw.apt.web.annotation.operate.Post;
27 27
import org.jfw.util.ConstData;
28 28
import org.jfw.util.io.IoUtil;
29 29
import org.jfw.util.json.JsonService;
30
import org.jfw.util.log.LogFactory;
31
import org.jfw.util.log.Logger;
30 32
import org.jfw.util.reflect.TypeReference;
31 33

32 34
import com.ekexiu.operation.push.getui.Message;
@ -36,7 +38,7 @@ import com.ekexiu.operation.push.getui.NotificationMessage;
36 38

37 39
@Path("/push")
38 40
public class PushService {
39
	private static final org.apache.log4j.Logger log = org.apache.log4j.Logger.getLogger(PushService.class);
41
	private static final Logger log =LogFactory.getLog(PushService.class);
40 42

41 43
	private static Type RES_TYPE = new TypeReference<Map<String, Object>>() {
42 44
	}.getType();

+ 1 - 0
src/main/resources/META-INF/services/org.jfw.util.log.LogFactory

@ -0,0 +1 @@
1
com.ekexiu.portal.util.Log4jLogFactory