• R/O
  • HTTP
  • SSH
  • HTTPS

RabbitBTS: Commit

RabbitBTSのgitリポジトリ


Commit MetaInfo

Revisioncc29b53e134f1e3a07666b1066f7caf4dad0af6c (tree)
Time2009-08-25 19:00:58
Authorsenju <senju@user...>
Commitersenju

Log Message

ログの形式をlogbackに修正。

Change Summary

Incremental Difference

--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,5 @@
33 *.bin
44 *.tgz
55 *.swp
6+log.xml
67 datastore-indexes-auto.xml
--- a/build.xml
+++ b/build.xml
@@ -14,7 +14,16 @@
1414 </fileset>
1515 </path>
1616
17+ <target name="init">
18+ <delete>
19+ <fileset dir=".">
20+ <include name="**/*.swp" />
21+ </fileset>
22+ </delete>
23+ </target>
24+
1725 <target name="copyjars"
26+ depends="init"
1827 description="Copies the App Engine JARs to the WAR.">
1928 <copy
2029 todir="war/WEB-INF/lib"
--- /dev/null
+++ b/doc/deploy.txt
@@ -0,0 +1,4 @@
1+logback/jul切り替え(ログレベル含む)
2+freemarkerのキャッシュを切る
3+トレースインターセプターを切る
4+メッセージソースのリロード時間を切る
--- a/src/jp/sourceforge/rabbitBTS/interceptors/AuthenticationInterceptor.java
+++ b/src/jp/sourceforge/rabbitBTS/interceptors/AuthenticationInterceptor.java
@@ -57,7 +57,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
5757 // アカウント未登録の場合、登録ページにリダイレクトする。
5858 response.sendRedirect("/register/");
5959 Sht.log(this).warn(
60- "403(not registerd.) " + request.getRequestURL());
60+ "403(not registerd.) {}", request.getRequestURL());
6161 return false;
6262 } catch (final HasNotValidIdException e) {
6363 if (handler instanceof IPublicController) {
@@ -67,7 +67,7 @@ public class AuthenticationInterceptor extends HandlerInterceptorAdapter {
6767
6868 // ログインしていない場合、ログインページにリダイレクトする。
6969 response.sendRedirect(Sht.loginUrl(request));
70- Sht.log(this).warn("403 " + request.getRequestURL());
70+ Sht.log(this).warn("403 {}", request.getRequestURL());
7171 return false;
7272 }
7373 }
--- 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).trace("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).trace("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
@@ -107,13 +107,13 @@ public class AccountService {
107107 if (account.getEmail().equals(this.firstSuperUser)) {
108108 account.setAdmin(true);
109109 Sht.log(this).warn(
110- "Admin Account Created. " + this.firstSuperUser);
110+ "Admin Account Created. {}", this.firstSuperUser);
111111 }
112112
113113 // nickName重複チェック
114114 if (this.accountDao.findAccountByNickName(account.getNickName()) != null) {
115115 Sht.log(this).info(
116- "nickName " + account.getNickName() + " is already used.");
116+ "nickName {} is already used.", account.getNickName());
117117 throw new RabbitBTSException("nickNameが重複しています。");
118118 }
119119
--- /dev/null
+++ b/war/WEB-INF/classes/logback.xml
@@ -0,0 +1,26 @@
1+<?xml version="1.0" encoding="utf-8" ?>
2+<!-- vim:set ts=2 sts=2 sw=2 et fenc=utf-8 -->
3+<configuration scan="true" scanPeriod="3 seconds">
4+ <appender name="STDOUT"
5+ class="ch.qos.logback.core.ConsoleAppender">
6+ <layout class="ch.qos.logback.classic.PatternLayout">
7+ <Pattern>
8+ %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg %ex %n
9+ </Pattern>
10+ </layout>
11+ </appender>
12+<appender name="FILE" class="ch.qos.logback.core.FileAppender">
13+ <File>log.xml</File>
14+ <layout class="ch.qos.logback.classic.log4j.XMLLayout">
15+ <LocationInfo>true</LocationInfo>
16+ </layout>
17+ </appender>
18+
19+ <logger name="jp.sourceforge.rabbitBTS" level="TRACE" />
20+ <logger name="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver" level="OFF" />
21+ <root level="INFO">
22+ <appender-ref ref="STDOUT" />
23+ <appender-ref ref="FILE" />
24+ </root>
25+
26+</configuration>
Show on old repository browser