<inceptionYear>2008</inceptionYear>
        <dependencies>
                <dependency>
-                       <groupId>log4j</groupId>
-                       <artifactId>log4j</artifactId>
-                       <version>1.2.13</version>
-                       <scope>compile</scope>
-               </dependency>
-               <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                        <version>3.8.1</version>
                        </plugin>
                        <plugin>
                                <groupId>org.apache.maven.plugins</groupId>
-                               <artifactId>maven-dependency-plugin</artifactId>
-                               <executions>
-                                       <execution>
-                                               <id>copy-my-dependencies</id>
-                                               <phase>generate-resources</phase>
-                                               <goals>
-                                                       <goal>unpack-dependencies</goal>
-                                               </goals>
-                                               <configuration>
-                                                       <includeScope>compile</includeScope>
-                                                       <outputDirectory>${project.build.directory}/classes</outputDirectory>
-                                                       <excludes>META-INF/**</excludes>
-                                               </configuration>
-                                       </execution>
-                               </executions>
-                       </plugin>
-                       <plugin>
-                               <groupId>org.apache.maven.plugins</groupId>
                                <artifactId>maven-jar-plugin</artifactId>
                                <configuration>
                                        <archive>
-                                               <index>true</index>
                                                <manifest>
                                                        <addClasspath>true</addClasspath>
                                                        <mainClass>org.hnaves.dfs.Main</mainClass>
 
 package org.hnaves.dfs;
 
 import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
 import java.net.InetSocketAddress;
+import java.util.logging.LogManager;
 
 import org.hnaves.dfs.election.Node;
 import org.hnaves.dfs.http.HttpServer;
 
 public class Main {
-       public static void main(String[] args) throws Exception {
+       
+       private void run(String[] args) throws SecurityException, IOException {
+               InputStream is = this.getClass().getResourceAsStream("/log/log.properties");
+               LogManager.getLogManager().readConfiguration(is);
                HttpServer server = new HttpServer(new Node(args[0], new InetSocketAddress(args[1], Node.DEFAULT_UDP_PORT)), new File("."), 10700);
-               server.run();
+               server.run();           
+       }
+       
+       public static void main(String[] args) throws Exception {
+               new Main().run(args);
        }
 }
 
@@ -6,8 +6,9 @@ import java.util.HashSet; 
 import java.util.LinkedList;
 import java.util.Queue;
 import java.util.Set;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
-import org.apache.log4j.Logger;
 import org.hnaves.dfs.election.messages.Accept;
 import org.hnaves.dfs.election.messages.AcceptReply;
 import org.hnaves.dfs.election.messages.AreYouCoordinator;
@@ -21,7 +22,7 @@ import org.hnaves.dfs.election.messages.ReadyReply; 
 import org.hnaves.dfs.election.socket.UDPSocket;
 
 public class Election {
-       private final Logger LOG = Logger.getLogger(this.getClass());
+       private static final Logger LOG = Logger.getLogger(Election.class.getName());
        
        private static final int DISCOVERY_TIMEOUT = 10000;
        private static final int QUERY_COORDINATOR_TIMEOUT = 1000;
@@ -59,11 +60,11 @@ public class Election { 
                                try {
                                        Message message = socket.receiveMessage();
                                        if (message != null && !message.getSourceNode().equals(id)) {
-                                               LOG.debug("Processing message " + message);
+                                               LOG.fine("Processing message " + message);
                                                processMessage(message);
                                        }
                                } catch(Throwable t) {
-                                       LOG.error("Exception while receiving message", t);
+                                       LOG.log(Level.SEVERE, "Exception while receiving message", t);
                                }
                        }
                }
@@ -85,7 +86,7 @@ public class Election { 
                                                Election.this.wait(MAIN_THREAD_WAIT);
                                        }
                                } catch(Throwable t) {
-                                       LOG.error("Exception while running", t);
+                                       LOG.log(Level.SEVERE, "Exception while running", t);
                                }
                        }                       
                }
@@ -103,7 +104,7 @@ public class Election { 
                                        }
                                        processInvitation(invitation);
                                } catch(Throwable t) {
-                                       LOG.error("Exception while processing invitation", t);
+                                       LOG.log(Level.SEVERE, "Exception while processing invitation", t);
                                }
                        }
 
@@ -183,7 +184,7 @@ public class Election { 
                        if (coordinatorAccepted) {
                                setStatus(Status.REORGANIZATION);
                        } else {
-                               LOG.debug("Coordinator of " + id + " not accepted!!!");
+                               LOG.fine("Coordinator of " + id + " not accepted!!!");
                                setStatus(Status.RECOVERY);
                        }
                }               
@@ -240,7 +241,7 @@ public class Election { 
 
                otherCoordinators.remove(group.getCoordinator());
                if (!otherCoordinators.isEmpty()) {
-                       LOG.debug("Other coordinator of " + id + " " + otherCoordinators);
+                       LOG.fine("Other coordinator of " + id + " " + otherCoordinators);
                        wait(TIME_CONSTANT * id.getPriority());
                        setStatus(Status.MERGE);
                }
@@ -269,7 +270,7 @@ public class Election { 
 
                wait(READY_TIMEOUT);
                if (numReadyAnswers < upNodes.size()) {
-                       LOG.debug("Missing " + (upNodes.size() - numReadyAnswers) + " ready answers in " + id);
+                       LOG.fine("Missing " + (upNodes.size() - numReadyAnswers) + " ready answers in " + id);
                        setStatus(Status.RECOVERY);
                } else {
                        setStatus(Status.NORMAL);
@@ -284,13 +285,13 @@ public class Election { 
                wait(QUERY_COORDINATOR_TIMEOUT);
 
                if (!isCoordinatorAlive) {
-                       LOG.debug("Coordinator is not alive in node "  + id + "!!!");
+                       LOG.fine("Coordinator is not alive in node "  + id + "!!!");
                        setStatus(Status.RECOVERY);
                }
        }
        
        private synchronized void setStatus(Status status) {
-               LOG.debug("Entering " + status  + " status in node " + id);
+               LOG.fine("Entering " + status  + " status in node " + id);
                this.status = status;
                for(ElectionListener listener : listeners) {
                        listener.onStateChange(this);
@@ -299,17 +300,17 @@ public class Election { 
        }
        
        private void setGroup(Group group) {
-               LOG.debug("Changing to group " + group  + " in node " + id);
+               LOG.fine("Changing to group " + group  + " in node " + id);
                this.group = group;
        }
        
        private void sendMessage(Message message, Node destination) throws IOException {
-               LOG.debug("Node " + id + " sending message " + message + " to " + destination);
+               LOG.fine("Node " + id + " sending message " + message + " to " + destination);
                socket.sendMessage(message, destination);
        }
        
        private void broadcastMessage(Message message) throws IOException {
-               LOG.debug("Node " + id + " broadcasting message " + message);
+               LOG.fine("Node " + id + " broadcasting message " + message);
                socket.broadcastMessage(message);
        }
        
@@ -344,7 +345,7 @@ public class Election { 
        
        public synchronized void start() {
                if (status == null) {
-                       LOG.debug("Starting Node " + id +  "...");
+                       LOG.fine("Starting Node " + id +  "...");
                        status = Status.RECOVERY;
                        invitationThread.start();
                        receiverThread.start();
@@ -353,7 +354,7 @@ public class Election { 
        }
        
        public synchronized void stop() {
-               LOG.debug("Stopping Node " + id + " ...");
+               LOG.fine("Stopping Node " + id + " ...");
                setStatus(Status.DOWN);
        }
        
 
@@ -5,13 +5,14 @@ import java.net.DatagramPacket; 
 import java.net.DatagramSocket;
 import java.net.InetSocketAddress;
 import java.net.SocketTimeoutException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
-import org.apache.log4j.Logger;
 import org.hnaves.dfs.election.Node;
 import org.hnaves.dfs.election.messages.Message;
 
 public class UDPSocket {
-       private final Logger LOG = Logger.getLogger(this.getClass());
+       private static final Logger LOG = Logger.getLogger(UDPSocket.class.getName());
        private final DatagramSocket socket;
        
        public UDPSocket() {
@@ -31,7 +32,7 @@ public class UDPSocket { 
        
        private DatagramPacket createPacket(Message message) throws IOException {
                byte[] data = message.createPacket();
-               LOG.debug("Packet size " + data.length);
+               LOG.fine("Packet size " + data.length);
                DatagramPacket packet = new DatagramPacket(data, data.length);
                return packet;
        }
@@ -39,7 +40,7 @@ public class UDPSocket { 
        public void sendMessage(Message message, Node destination) throws IOException {
                if (message == null) throw new NullPointerException("Message is null");
                if (destination == null) throw new NullPointerException("Destination is null");
-               LOG.debug("Send Message " + message + " to " + destination);
+               LOG.fine("Send Message " + message + " to " + destination);
                DatagramPacket packet = createPacket(message);
                packet.setSocketAddress(destination.getAddress());
                socket.send(packet);
@@ -47,7 +48,7 @@ public class UDPSocket { 
        
        public void broadcastMessage(Message message, int port) throws IOException {
                if (message == null) throw new NullPointerException("Message is null");
-               LOG.debug("Broadcast Message " + message);
+               LOG.fine("Broadcast Message " + message);
                DatagramPacket packet = createPacket(message);
                InetSocketAddress destination = new InetSocketAddress("255.255.255.255", port);
                packet.setSocketAddress(destination);
@@ -63,14 +64,14 @@ public class UDPSocket { 
                DatagramPacket packet = new DatagramPacket(new byte[1024], 1024);
                try {
                        socket.receive(packet);
-                       LOG.debug("Receiving from " + packet.getSocketAddress());
+                       LOG.fine("Receiving from " + packet.getSocketAddress());
                        Message message = Message.getInstanceFromPacket(packet.getData());
-                       LOG.debug("Received Message " + message);
+                       LOG.fine("Received Message " + message);
                        return message;
                } catch(SocketTimeoutException ex) {
                        return null;
                } catch (Throwable t) {
-                       LOG.debug("Exception while receiveMessage", t);
+                       LOG.log(Level.SEVERE, "Exception while receiveMessage", t);
                        return null;
                }
        }
 
@@ -14,8 +14,9 @@ import java.util.Map; 
 import java.util.StringTokenizer;
 import java.util.Timer;
 import java.util.TimerTask;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 
-import org.apache.log4j.Logger;
 import org.hnaves.dfs.election.Election;
 import org.hnaves.dfs.election.ElectionListener;
 import org.hnaves.dfs.election.Node;
@@ -26,7 +27,7 @@ import org.hnaves.dfs.repository.Repository; 
 import org.hnaves.dfs.repository.utils.ObjectUtils;
 
 public class HttpServer implements ElectionListener {
-       private static final Logger LOG = Logger.getLogger(HttpServer.class);
+       private static final Logger LOG = Logger.getLogger(HttpServer.class.getName());
        private final static String CRLF = "\r\n";
 
        private final Election election;
@@ -57,7 +58,7 @@ public class HttpServer implements ElectionListener { 
                                try {
                                        Node coordinator = election.getGroupCoodinatorInNormalState();
                                        if (coordinator != null && !coordinator.equals(election.getId())) {
-                                               LOG.debug("Updating to server " + coordinator);
+                                               LOG.fine("Updating to server " + coordinator);
                                                Socket clientSocket = new Socket(coordinator.getAddress().getAddress(), port);
                                                InputStream is = clientSocket.getInputStream();
                                                OutputStream out = clientSocket.getOutputStream();
@@ -69,13 +70,13 @@ public class HttpServer implements ElectionListener { 
                                                clientSocket.shutdownOutput();
                                                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                                                transferBytes(is, baos);
-                                               LOG.debug("RECEIVED: " + baos);
+                                               LOG.fine("RECEIVED: " + baos);
                                                out.close();
                                                is.close();
                                                clientSocket.close();
                                        }
                                } catch(Exception ex) {
-                                       LOG.error("Error in timer task", ex);
+                                       LOG.log(Level.SEVERE,"Error in timer task", ex);
                                }
                        }
                        
@@ -96,11 +97,11 @@ public class HttpServer implements ElectionListener { 
                                        Thread thread = new Thread(request);
                                        thread.start();
                                } catch (Exception e) {
-                                       LOG.error("Error while handling request", e);
+                                       LOG.log(Level.SEVERE,"Error while handling request", e);
                                }
                        }
                } catch (IOException e) {
-                       LOG.error("IO error", e);
+                       LOG.log(Level.SEVERE,"IO error", e);
                }
 
        }
@@ -123,7 +124,7 @@ public class HttpServer implements ElectionListener { 
                        try {
                                processRequest();
                        } catch (Exception e) {
-                               LOG.error("Exception in request handler", e);
+                               LOG.log(Level.SEVERE,"Exception in request handler", e);
                        }
                }
 
@@ -131,7 +132,7 @@ public class HttpServer implements ElectionListener { 
                        String postRequest = null;
                        while (true) {
                                String headerLine = readLine(is);
-                               LOG.debug("HEADER: " + headerLine);
+                               LOG.fine("HEADER: " + headerLine);
                                if (headerLine.equals(CRLF) || headerLine.equals(""))
                                        break;
 
@@ -140,7 +141,7 @@ public class HttpServer implements ElectionListener { 
 
                                if ("GET".equals(cmd)) {
                                        String request = tokenizer.nextToken();
-                                       LOG.debug("Request: " + request);
+                                       LOG.fine("Request: " + request);
                                        
                                        if ("/local/".equals(request)) {
                                                sendListing(true);
 
@@ -4,13 +4,13 @@ import java.io.File; 
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.logging.Logger;
 
-import org.apache.log4j.Logger;
 import org.hnaves.dfs.election.Node;
 
 public class Container implements Serializable {
        private static final long serialVersionUID = 4190763929963328455L;
-       private static final Logger LOG = Logger.getLogger(Container.class);
+       private static final Logger LOG = Logger.getLogger(Container.class.getName());
        
        private final Node location;
        private final ArrayList<ContentItem> content = new ArrayList<ContentItem>();
@@ -50,14 +50,14 @@ public class Container implements Serializable { 
                for(File file : directory.listFiles()) {
                        if (!file.isFile()) continue;
                        if (file.getName().startsWith(".")) continue;
-                       LOG.debug("Found file " + file.getName());
+                       LOG.fine("Found file " + file.getName());
                        ContentItem oldItem = oldContent.get(file.getName());
                        if (oldItem != null && oldItem.getLastModified().getTime() == file.lastModified() &&
                                        (oldItem.getSize() == (int) file.length())) {
-                               LOG.debug("Using old hash " + oldItem.getMd5Hash());
+                               LOG.fine("Using old hash " + oldItem.getMd5Hash());
                                content.add(oldItem);
                        } else {
-                               LOG.debug("New item!");
+                               LOG.fine("New item!");
                                ContentItem item = new ContentItem(file);
                                content.add(item);
                        }
 
@@ -10,13 +10,12 @@ import java.nio.channels.FileChannel; 
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.Date;
-
-import org.apache.log4j.Logger;
+import java.util.logging.Logger;
 
 public class ContentItem implements Serializable {
        
        private static final long serialVersionUID = -2943849225159883158L;
-       private final static Logger LOG = Logger.getLogger(ContentItem.class);
+       private final static Logger LOG = Logger.getLogger(ContentItem.class.getName());
 
        private final String name;
        private final Date lastModified;
@@ -48,7 +47,7 @@ public class ContentItem implements Serializable { 
        }
        
        private String md5Hash(File localFile) throws NoSuchAlgorithmException, IOException {
-               LOG.debug("Hashing file " + localFile);
+               LOG.fine("Hashing file " + localFile);
                MessageDigest digest = MessageDigest.getInstance("MD5");
                FileChannel fcl = new RandomAccessFile(localFile, "r").getChannel();
                ByteBuffer bl = fcl.map(FileChannel.MapMode.READ_ONLY, 0, (int) fcl.size());
 
@@ -3,12 +3,12 @@ package org.hnaves.dfs.repository; 
 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.logging.Logger;
 
-import org.apache.log4j.Logger;
 import org.hnaves.dfs.election.Node;
 
 public class Repository {
-       private static final Logger LOG = Logger.getLogger(Repository.class);
+       private static final java.util.logging.Logger LOG = Logger.getLogger(Repository.class.getName());
        
        private final Container localFiles;
        private final Map<Node, Container> remoteFiles = new HashMap<Node, Container>();
@@ -53,7 +53,7 @@ public class Repository { 
        }
        
        public synchronized void updateLocalFiles() {
-               LOG.debug("Updating local files...");
+               LOG.fine("Updating local files...");
                localFiles.updateFiles(repositoryDirectory);
        }
        
 
--- /dev/null
+# Specify the handlers to create in the root logger
+# (all loggers are children of the root logger)
+# The following creates two handlers
+handlers = java.util.logging.ConsoleHandler, java.util.logging.FileHandler
+    
+# Set the default logging level for the root logger
+.level = ALL
+    
+# Set the default logging level for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.level = ALL
+    
+# Set the default logging level for new FileHandler instances
+java.util.logging.FileHandler.level = ALL
+    
+# Set the default formatter for new ConsoleHandler instances
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+    
 
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-  <appender name="APPENDER" class="org.apache.log4j.ConsoleAppender">
-    <param name="Target" value="System.out"/>
-
-    <layout class="org.apache.log4j.PatternLayout">
-      <!-- The default pattern: Date Priority [Category] Message\n -->
-      <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-    </layout>
-  </appender>
-
-  <logger name="org.hnaves.dfs.election">
-    <level value="DEBUG"/>
-  </logger>
-
-  <logger name="org.hnaves.dfs.repository">
-    <level value="DEBUG"/>
-  </logger>
-
-  <logger name="org.hnaves.dfs.election.socket">
-    <level value="WARN"/>
-  </logger>
-  <root>
-    <level value="DEBUG"/>
-    <appender-ref ref="APPENDER"/>
-  </root>
-</log4j:configuration>