Index: controlies/Utils/avahiClient.py
===================================================================
--- controlies/Utils/avahiClient.py	(revision 96)
+++ controlies/Utils/avahiClient.py	(revision 97)
@@ -40,6 +40,7 @@
 
 from twisted.internet import defer, threads
 from twisted.internet import glib2reactor
+import logging
 glib2reactor.install()
 
 class avahiClient():
@@ -82,7 +83,8 @@
 				cb(self,name, address, port)
 				
 		def resolve_service_error(exception):
-			self.warning('could not resolve daap service %s %s: %s' % (name, domain, exception))
+			logging.getLogger().debug('could not resolve daap service %s %s: %s' % (name, domain, exception))			
+			#self.warning('could not resolve daap service %s %s: %s' % (name, domain, exception))
 
 		self.server.ResolveService(interface, protocol, name, type, domain,
 				avahi.PROTO_UNSPEC, dbus.UInt32(0),
Index: controlies/Plugins/LdapConnection.py
===================================================================
--- controlies/Plugins/LdapConnection.py	(revision 96)
+++ controlies/Plugins/LdapConnection.py	(revision 97)
@@ -94,7 +94,7 @@
 						result_set.append(result_data)
 			return result_set
 		except ldap.LDAPError, e:
-			print e
+			logging.getLogger().debug('LDAP error search')
 		
 		"""result = con.search_s( base_dn, ldap.SCOPE_SUBTREE, filter, attrs )
 		return result"""
@@ -104,11 +104,11 @@
 			self.connection.add_s(baseDN+",dc=instituto,dc=extremadura,dc=es", attr)
 			
 		except ldap.ALREADY_EXISTS:
-			print "already exists"
+			logging.getLogger().debug("LDAP already exists %s" % (baseDN))
 		except ldap.OPERATIONS_ERROR:
-			print "error"
+			logging.getLogger().debug("LDAP operation error %s" % (baseDN))
 		except ldap.NO_SUCH_OBJECT:
-			print "no_such_object"
+			logging.getLogger().debug("LDAP no such object %s" % (baseDN))
 			
 		return True
 
Index: controlies/www/classroomServers/index.html
===================================================================
--- controlies/www/classroomServers/index.html	(revision 96)
+++ controlies/www/classroomServers/index.html	(revision 97)
@@ -39,10 +39,20 @@
 				$('#selectable #selectable-'+computer[1]+' #userName').html(computer[0]);
 				$('#selectable #selectable-'+computer[1]+' .thumb-image').attr('src','img/nobody.png');
 			});
+
+			//getLTSPClients();
 			
 			setTimeout("getLTSPStatus()",10000);			
 		});
 	}
+
+	function getLTSPClients(){
+		$.post('hosts','action=getLTSPClients', function(data) {
+			var result = $.parseJSON(data);
+			
+			setTimeout("getLTSPClients()",25000);			
+		});
+	}
 	
 </script>
 
Index: controlies/MainLoop.py
===================================================================
--- controlies/MainLoop.py	(revision 96)
+++ controlies/MainLoop.py	(revision 97)
@@ -206,10 +206,28 @@
 				
 				f = open('/tmp/controlIES.ltpsTeachers', 'r')
 				teachers = f.read().split(" ")
-				teachers.sort()
+				teachers.sort()				
 				
 				return json.dumps({ "computers":computers, "teachers":teachers })
+
+        	elif request.args['action'][0] == "getLTSPClients":
+								
+				import xmlrpclib
 				
+				h = Hosts (l,"","","","","")
+				response = h.getLTSPServers ()
+				
+				clients = []
+				for server in response:
+					s = xmlrpclib.Server("http://"+server+":8900")
+					print "connect: "+server
+					try:
+						clients[server] = s.Hosts()
+					except:
+						pass
+				
+				return json.dumps({ "clients":clients })
+
         	else:
 				if request.args ['type'][0] == 'thinclient':
 					ip = ""
Index: controlies/Server.py
===================================================================
--- controlies/Server.py	(revision 96)
+++ controlies/Server.py	(revision 97)
@@ -23,22 +23,31 @@
 ##############################################################################
 
 from Utils.avahiClient import avahiClient
-
+from Utils import Configs
 from twisted.web import static, server
 from twisted.web.server import Session
 from twisted.python.components import registerAdapter
+import logging,logging.handlers
 import MainLoop
 from zope.interface import Interface, Attribute, implements
 from Plugins.LdapConnection import LdapConnection, ILdapConnection
 import os.path
 
+# Logging
+log_handler = logging.handlers.RotatingFileHandler(Configs.LOG_FILENAME, maxBytes=100000, backupCount=5)
+log_formatter = logging.Formatter(fmt='%(asctime)s %(levelname)-8s %(message)s',datefmt='%a, %d %b %Y %H:%M:%S')
+log_handler.setFormatter(log_formatter)
+root_logger=logging.getLogger() 
+root_logger.addHandler(log_handler)
+root_logger.level=logging.DEBUG
 
+
 registerAdapter(LdapConnection, Session, ILdapConnection)
 
 # Start up the web service.     
 Root = MainLoop.ControlIESProtocol() #Resource object
-#Root.PageDir='/home/manu/proyectos/controlies/www/'
-Root.PageDir='/home/chisco/Proyectos/controlies/www'
+Root.PageDir='/home/manu/proyectos/controlies/www/'
+#Root.PageDir='/home/chisco/Proyectos/controlies/www'
 site = server.Site(Root)
 
 fileNameServers = '/tmp/controlIES.ltpsSevers'
@@ -102,10 +111,8 @@
 	_monitor.add_callback('new-service', _add_locationServers)
 	_monitor.add_callback('remove-service', _remove_locationServers)
 	_monitor.start()
-	
 except Exception, ex:
-	error_msg = "Couldn't initialize Avahi monitor: %s" % str(ex)
-	#raise InitializeFailure(self.name, error_msg)
+	logging.getLogger().debug("Couldn't initialize Avahi monitor: workstations")
 
 
 try:	
@@ -112,11 +119,9 @@
 	_monitor = avahiClient('_controlaula._tcp')	
 	_monitor.add_callback('new-service', _add_locationTeachers)
 	_monitor.add_callback('remove-service', _remove_locationTeachers)
-	_monitor.start()
-	
+	_monitor.start()	
 except Exception, ex:
-	error_msg = "Couldn't initialize Avahi monitor: %s" % str(ex)
-	#raise InitializeFailure(self.name, error_msg)
+	logging.getLogger().debug("Couldn't initialize Avahi monitor: controlaula")
 
 
 from twisted.internet import reactor
