On 17-8-2013 22:23, D. Xenakis wrote: > Hi there. I have a script-service running on a remote server, listening on a > specific port. What i need here is to make this also maintain a log file of > ALL incoming connections. > > Could someone suggest to me a simple codefunction example to implement that > on my main running service? > > THX!! >
One approach could be simply to log the client socket's peername to a logfile, something like this: import logging log=logging.getLogger("connections") ... if <<new connection>>: clientsocket = ... log.debug("new connection from "+clientsocket.getpeername()) ... Irmen -- http://mail.python.org/mailman/listinfo/python-list