Novo fonte
authorHumberto Silva Naves <[email protected]>
Mon, 24 Nov 2008 18:54:23 +0000 (24 16:54 -0200)
committerHumberto Silva Naves <[email protected]>
Mon, 24 Nov 2008 18:54:23 +0000 (24 16:54 -0200)
src/main/java/org/hnaves/dfs/election/Election.java
src/main/java/org/hnaves/dfs/repository/Container.java
src/main/resources/log/log.properties

index 67fbee8..c0b28a5 100644 (file)
@@ -86,7 +86,6 @@ public class Election {
                                        if (status == Status.DOWN) break;
                                }
                                try {
-                                       LOG.fine("Main loop\n\n");
                                        check();
                                        merge();
                                        recovery();
@@ -131,7 +130,7 @@ public class Election {
 
        public synchronized void start() {
                if (status == null) {
-                       LOG.fine("Starting Node " + id +  "...");
+                       LOG.fine("Starting Node " + id +  "...\n");
                        setStatus(Status.RECOVERY);
                        receiverThread.start();
                        mainThread.start();
@@ -140,7 +139,7 @@ public class Election {
        
        public void stop() throws InterruptedException {
                synchronized(this) {
-                       LOG.fine("Stopping Node " + id + " ...");
+                       LOG.fine("Stopping Node " + id + " ...\n");
                        setStatus(Status.DOWN);
                }
                mainThread.join();
@@ -335,7 +334,7 @@ public class Election {
                wait(Configurator.getAreYouThereTimeout());
 
                if (!isCoordinatorAlive) {
-                       LOG.fine("Coordinator is not alive in node "  + id + "!!!");
+                       LOG.fine("Coordinator is not alive in node "  + id + "!!!\n");
                        setStatus(Status.RECOVERY);
                }
        }
@@ -361,7 +360,7 @@ public class Election {
        }
        
        private void setGroupAndCoordinator(long group, Node groupCoordinator) {
-               LOG.fine("Changing to group " + group  + " coordinator " + groupCoordinator + " in node " + id + "\n\n");
+               LOG.fine("Changing to group " + group  + " coordinator " + groupCoordinator + " in node " + id + "\n");
                this.group = group;
                this.groupCoordinator = groupCoordinator;
        }
index 268edd5..61a7d38 100644 (file)
@@ -73,7 +73,7 @@ public class Container implements Serializable {
                for(File file : directory.listFiles()) {
                        if (!file.isFile()) continue;
                        if (file.getName().startsWith(".")) continue;
-                       if (file.getName().startsWith("dfs") && file.getName().endsWith(".log")) continue;
+                       if (file.getName().startsWith("dfs.log")) continue;
                        if (file.getName().equals("index.dat") || file.getName().equals("config.ini")) continue;
                        
                        LOG.fine("Found file " + file.getName());
index 67aa61b..90bcfa4 100644 (file)
@@ -7,9 +7,7 @@ handlers = java.util.logging.FileHandler, java.util.logging.ConsoleHandler
 .level = ALL
 
 org.hnaves.dfs.repository.level=WARNING
-org.hnaves.dfs.election.pattern = dfs-election.log
 org.hnaves.dfs.election.socket.level=WARNING
-org.hnaves.dfs.election.socket.pattern = dfs-election-socket.log
 
 java.util.logging.FileHandler.level = ALL
 java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter