r6876 - in dumbhippo/trunk: imbot/src/java/com/dumbhippo/aimbot super/imbot/files/scripts



Author: walters
Date: 2007-11-07 15:43:16 -0600 (Wed, 07 Nov 2007)
New Revision: 6876

Modified:
   dumbhippo/trunk/imbot/src/java/com/dumbhippo/aimbot/Main.java
   dumbhippo/trunk/super/imbot/files/scripts/imbot-start.sh
Log:
Change imbot logs to be DailyRollingFileAppender for future debugging.



Modified: dumbhippo/trunk/imbot/src/java/com/dumbhippo/aimbot/Main.java
===================================================================
--- dumbhippo/trunk/imbot/src/java/com/dumbhippo/aimbot/Main.java	2007-11-07 17:41:12 UTC (rev 6875)
+++ dumbhippo/trunk/imbot/src/java/com/dumbhippo/aimbot/Main.java	2007-11-07 21:43:16 UTC (rev 6876)
@@ -1,10 +1,15 @@
 package com.dumbhippo.aimbot;
 
+import java.io.File;
+import java.io.IOException;
+
 import javax.jms.JMSException;
 import javax.jms.Message;
 import javax.jms.ObjectMessage;
 
+import org.apache.log4j.Appender;
 import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.DailyRollingFileAppender;
 import org.apache.log4j.Level;
 import org.apache.log4j.PatternLayout;
 import org.slf4j.Logger;
@@ -157,12 +162,13 @@
 		return t;
 	}
 	
-	public static void main(String[] args) {
+	public static void main(String[] args) throws IOException {
 		
 		// init log4j, if we weren't lazy we might load it from a config file, 
 		// but we are lazy
 		org.apache.log4j.Logger log4jRoot = org.apache.log4j.Logger.getRootLogger();
-		ConsoleAppender appender = new ConsoleAppender(new PatternLayout("%d %-5p [%c] (%t): %m%n"));
+		Appender appender = new DailyRollingFileAppender(new PatternLayout("%d %-5p [%c] (%t): %m%n"), 
+				                                         new File(System.getProperty("imbot.logdir"), "imbot.log").getPath(), "'.'yyyy-MM-dd");
 		log4jRoot.addAppender(appender);
 		log4jRoot.setLevel(Level.DEBUG);
 		

Modified: dumbhippo/trunk/super/imbot/files/scripts/imbot-start.sh
===================================================================
--- dumbhippo/trunk/super/imbot/files/scripts/imbot-start.sh	2007-11-07 17:41:12 UTC (rev 6875)
+++ dumbhippo/trunk/super/imbot/files/scripts/imbot-start.sh	2007-11-07 21:43:16 UTC (rev 6876)
@@ -22,7 +22,7 @@
 "$JAVA" -Xdebug 					\
      -server 						\
      -classpath $deps:$targetdir/conf:$targetdir/dumbhippo-imbot.jar 	\
-     com.dumbhippo.aimbot.Main  >$targetdir/logs/imbot.log 2>&1 &
+     -Dimbot.logdir="${targetdir}/logs" com.dumbhippo.aimbot.Main 2>&1 &
 
 pid=$!
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]