• R/O
  • HTTP
  • SSH
  • HTTPS

RabbitBTS: Commit

RabbitBTSのgitリポジトリ


Commit MetaInfo

Revisiona9dc58700f58dfd87cd59337344e7b1de79eb665 (tree)
Time2009-08-25 15:40:56
Authorsenju <senju@user...>
Commitersenju

Log Message

とりあえずslf4jに対応。

Change Summary

Incremental Difference

--- a/build.xml
+++ b/build.xml
@@ -1,5 +1,5 @@
11 <!-- vim:set et sw=2 sts=2 ts=2 fenc=utf-8: -->
2-<project>
2+<project default="compile">
33 <property name="sdk.dir" location="../appengine-java-sdk-1.2.2" />
44
55 <import file="${sdk.dir}/config/user/ant-macros.xml" />
@@ -70,6 +70,7 @@
7070 <appcfg action="request_logs" war="war">
7171 <options>
7272 <arg value="--num_days=5"/>
73+ <arg value="--severity=0"/>
7374 </options>
7475 <args>
7576 <arg value="logs.txt"/>
@@ -77,5 +78,13 @@
7778 </appcfg>
7879 </target>
7980
81+ <target name="clean">
82+ <delete>
83+ <fileset dir="war/WEB-INF/classes">
84+ <include name="**/*.class" />
85+ </fileset>
86+ </delete>
87+ </target>
88+
8089 </project>
8190
--- a/jarlist
+++ b/jarlist
@@ -4,7 +4,6 @@ aspectjweaver.jar
44 cglib-nodep-2.1_3.jar
55 commons-collections-3.2.1.jar
66 commons-lang-2.4.jar
7-commons-logging.jar
87 freemarker.jar
98 jdo2-api-2.3-SNAPSHOT.jar
109 jstl.jar
@@ -20,3 +19,7 @@ spring-tx.jar
2019 spring-web.jar
2120 spring-webmvc.jar
2221 standard.jar
22+logback-classic-0.9.17.jar
23+logback-core-0.9.17.jar
24+slf4j-api-1.5.8.jar
25+jcl-over-slf4j-1.5.8.jar
--- a/src/jp/sourceforge/rabbitBTS/Sht.java
+++ b/src/jp/sourceforge/rabbitBTS/Sht.java
@@ -17,7 +17,8 @@
1717
1818 package jp.sourceforge.rabbitBTS;
1919
20-import java.util.logging.Logger;
20+import org.slf4j.Logger;
21+import org.slf4j.LoggerFactory;
2122
2223 import javax.servlet.http.HttpServletRequest;
2324
@@ -51,10 +52,10 @@ public final class Sht {
5152
5253 @SuppressWarnings("unchecked")
5354 public static final Logger log(Class c){
54- return Logger.getLogger(c.getName());
55+ return LoggerFactory.getLogger(c.getName());
5556 }
5657
5758 public static final Logger log(Object o){
58- return Logger.getLogger(o.getClass().getName());
59+ return LoggerFactory.getLogger(o.getClass().getName());
5960 }
6061 }
--- a/src/jp/sourceforge/rabbitBTS/controllers/BbsController.java
+++ b/src/jp/sourceforge/rabbitBTS/controllers/BbsController.java
@@ -60,7 +60,7 @@ public final class BbsController extends BaseController {
6060
6161 this.validator.validate(post, result);
6262 if (result.hasErrors()) {
63- Sht.log(this).finest("BBS Post Validate fail.");
63+ Sht.log(this).trace("BBS Post Validate fail.");
6464 return null;
6565 }
6666
--- a/src/jp/sourceforge/rabbitBTS/controllers/MembersController.java
+++ b/src/jp/sourceforge/rabbitBTS/controllers/MembersController.java
@@ -74,7 +74,7 @@ public class MembersController extends BaseController implements IController {
7474 }
7575
7676 if (account == null) {
77- Sht.log(this).warning("存在しないアカウントの削除が試行されました。");
77+ Sht.log(this).warn("存在しないアカウントの削除が試行されました。");
7878 }
7979
8080 map.addAttribute("accForDel", account);
--- a/src/jp/sourceforge/rabbitBTS/controllers/RegisterController.java
+++ b/src/jp/sourceforge/rabbitBTS/controllers/RegisterController.java
@@ -69,12 +69,12 @@ public final class RegisterController extends BaseController implements
6969 ret = null;
7070 } else {
7171 // すでに登録済みの場合ホームへリダイレクト
72- Sht.log(this).finer("既に登録済み");
72+ Sht.log(this).trace("既に登録済み");
7373 ret = REDIRECT_HOME_HTML;
7474 }
7575 } catch (final HasNotValidIdException e) {
7676 // googleにログインしてない場合
77- Sht.log(this).finer("ログインが必要");
77+ Sht.log(this).trace("ログインが必要");
7878 ret = "redirect:" + Sht.loginUrl(req);
7979 }
8080 return ret;
@@ -112,7 +112,7 @@ public final class RegisterController extends BaseController implements
112112 account.setEmail(Sht.user().getEmail());
113113 this.validator.validate(account, result);
114114 if (result.hasErrors()) {
115- Sht.log(this).finer("ユーザ登録画面にてバリデートに失敗");
115+ Sht.log(this).trace("ユーザ登録画面にてバリデートに失敗");
116116 return null;
117117 }
118118
@@ -121,13 +121,13 @@ public final class RegisterController extends BaseController implements
121121 if (this.accountService.fetchAccountByNickName(account
122122 .getNickName()) != null) {
123123 result.rejectValue("nickName", "Account.nickName[duplicate]");
124- Sht.log(this).finer("nickName重複チェックエラー");
124+ Sht.log(this).trace("nickName重複チェックエラー");
125125 return null;
126126 }
127127
128128 this.accountService.registAccount(account);
129129 } catch (final RabbitBTSException e) {
130- Sht.log(this).log(Level.WARNING, "ユーザー登録で例外発生", e);
130+ Sht.log(this).warn("ユーザー登録で例外発生", e);
131131 // TODO:resultにセット
132132 map.addAttribute("errorMessage", "登録に失敗しました。再度やりなおしてください。");
133133 return null;
--- a/src/jp/sourceforge/rabbitBTS/interceptors/AuthenticationInterceptor.java
+++ b/src/jp/sourceforge/rabbitBTS/interceptors/AuthenticationInterceptor.java
@@ -56,7 +56,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
5656 }
5757 // アカウント未登録の場合、登録ページにリダイレクトする。
5858 response.sendRedirect("/register/");
59- Sht.log(this).warning(
59+ Sht.log(this).warn(
6060 "403(not registerd.) " + request.getRequestURL());
6161 return false;
6262 } catch (final HasNotValidIdException e) {
@@ -67,7 +67,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
6767
6868 // ログインしていない場合、ログインページにリダイレクトする。
6969 response.sendRedirect(Sht.loginUrl(request));
70- Sht.log(this).warning("403 " + request.getRequestURL());
70+ Sht.log(this).warn("403 " + request.getRequestURL());
7171 return false;
7272 }
7373 }
--- a/src/jp/sourceforge/rabbitBTS/interceptors/CSRFInterceptor.java
+++ b/src/jp/sourceforge/rabbitBTS/interceptors/CSRFInterceptor.java
@@ -51,7 +51,7 @@ public class CSRFInterceptor extends HandlerInterceptorAdapter {
5151 c.setCsrfSafe(true);
5252 } else {
5353 c.setCsrfSafe(false);
54- Sht.log(this).warning("CSRF detected.");
54+ Sht.log(this).warn("CSRF detected.");
5555 }
5656 }
5757 return true;
@@ -78,7 +78,7 @@ public class CSRFInterceptor extends HandlerInterceptorAdapter {
7878 // きちんとCSRFチェックが行われているかチェックする
7979 final IController c = (IController) handler;
8080 if (!c.isCsrfChecked()) {
81- Sht.log(this).severe("CSRFチェックを行っていないPOST");
81+ Sht.log(this).error("CSRFチェックを行っていないPOST");
8282 }
8383 assert c.isCsrfChecked() : "CSRFチェックを行っていないPOST";
8484 }
--- a/src/jp/sourceforge/rabbitBTS/interceptors/TraceInterceptor.java
+++ b/src/jp/sourceforge/rabbitBTS/interceptors/TraceInterceptor.java
@@ -31,13 +31,13 @@ public class TraceInterceptor extends HandlerInterceptorAdapter {
3131 public void postHandle(HttpServletRequest request,
3232 HttpServletResponse response, Object handler,
3333 ModelAndView modelAndView) throws Exception {
34- Sht.log(this).finest("postHandle " + makeURL(request));
34+ Sht.log(this).trace("postHandle " + makeURL(request));
3535 }
3636
3737 @Override
3838 public boolean preHandle(HttpServletRequest request,
3939 HttpServletResponse response, Object handler) throws Exception {
40- Sht.log(this).finest("preHandle " + makeURL(request));
40+ Sht.log(this).trace("preHandle " + makeURL(request));
4141 return true;
4242 }
4343
--- a/src/jp/sourceforge/rabbitBTS/services/AccountService.java
+++ b/src/jp/sourceforge/rabbitBTS/services/AccountService.java
@@ -106,7 +106,7 @@ public class AccountService {
106106 // 最初のスーパーユーザーかチェック
107107 if (account.getEmail().equals(this.firstSuperUser)) {
108108 account.setAdmin(true);
109- Sht.log(this).warning(
109+ Sht.log(this).warn(
110110 "Admin Account Created. " + this.firstSuperUser);
111111 }
112112
Show on old repository browser