[MOBY-guts] biomoby commit

Eddie Kawas kawas at pub.open-bio.org
Thu Nov 10 16:09:07 UTC 2005


kawas
Thu Nov 10 11:09:07 EST 2005
Update of /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util
In directory pub.open-bio.org:/tmp/cvs-serv5705/org/biomoby/registry/rdfagent/util

Modified Files:
	Log.java 
Log Message:
modified the logger so that only one file is created. when the agent ran, a different log file was created for each iteration of the agent and each log file contained its current iteration as well as the future iterations.

moby-live/Java/src/main/org/biomoby/registry/rdfagent/util Log.java,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Log.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Log.java	2005/04/16 14:32:47	1.4
+++ /home/repository/moby/moby-live/Java/src/main/org/biomoby/registry/rdfagent/util/Log.java	2005/11/10 16:09:07	1.5
@@ -10,14 +10,18 @@
 public class Log {
 	
 	static Logger  logger;
-	
+	private static boolean isInit = false; 
 	
 	public static void start() {		
-				
-         logger = Logger.getLogger("org.biomoby.registry.rdfagent");
+		logger = Logger.getLogger("org.biomoby.registry.rdfagent");
+		// following ensures that only one log file is created.
+		if (isInit) {
+			return;
+		}
+         isInit =  true;
          	try {
     	  String logFile = Constants.RDFagentHome+Constants.SV_LOGFILE_PATH;	 
-          FileHandler fh = new FileHandler(logFile);
+          FileHandler fh = new FileHandler(logFile, true);
 			fh.setFormatter(new SimpleFormatter());			   
 				logger.addHandler(fh);
 				} catch (IOException e) {




More information about the MOBY-guts mailing list