synchronized public void readLog() {
		BufferedReader reader;
		try {
			File log = new File("log.txt");
			
			if(!log.exists())
			{
				PrintWriter writer = new PrintWriter("log.txt", "UTF-8");
				writer.println("allocatedmemory: 1073741824");
				writer.println("usedmemory: 0");
				writer.println("lastchunk: 0");
				writer.close();
			}
			
			reader = new BufferedReader(new FileReader("log.txt"));
			
			String line = null;
			while ((line = reader.readLine()) != null) {
			    String[] parts = line.split(" ");
			    
			    if(parts.length >= 2) {
			    	if(parts[0].equals("allocatedmemory:")) {
			    		setMaxSize(Integer.parseInt(parts[1]));
			    	}
			    	else if (parts[0].equals("lastchunk:")) {
			    		nextAvailableFileNo = Integer.parseInt(parts[1]);
			    	}
			    	else if (parts[0].equals("usedmemory:")) {
			    		setCurrSize(Integer.parseInt(parts[1]));
			    	}
			    	else if (parts[0].equals("file:") && parts.length == 5) {
			    		byte[] hash = Packet.hexToByte(parts[1]);
			    		int repDegree = Integer.parseInt(parts[3]);
			    		int numChunks = Integer.parseInt(parts[4]);
			    		
			    		
			    		files.add(new BackupFile(hash, parts[2], repDegree, numChunks));
			    	}
			    	else if (parts[0].equals("chunk:") && parts.length >= 6) {
			    		byte[] hash = Packet.hexToByte(parts[1]);
			    		int chunkNo = Integer.parseInt(parts[3]);
			    		int repDegree = Integer.parseInt(parts[4]);
			    		int curRepDeg = Integer.parseInt(parts[5]);
			    		int size = Integer.parseInt(parts[6]);
			    		
			    		ArrayList<InetAddress> stored = new ArrayList<InetAddress>();
			    		
			    		for(int i = 7; i < parts.length; i++) {
			    			stored.add(InetAddress.getByName(parts[i]));
			    		}
			    		
			    		backedUpChunks.add(new BackupChunk(hash, chunkNo, null, parts[2], size, repDegree, curRepDeg, stored));
			    	}
			    	
			    }
			}
			
			reader.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}