Hi, does anyone know of any logging mod that saves all the logs to a SQL database?
If you don't find one, I've hacked up some code for you. Run it on a server with python and twisted installed, and use that as your logaddress
[code]from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
from twisted.application.internet import MulticastServer
import MySQLdb
import time
db=MySQLdb.connect(user="username",passwd="password",db="log_db",)
c=db.cursor(MySQLdb.cursors.DictCursor)
class TF2LogInject(DatagramProtocol):
def startProtocol(self):
print 'Started Listening'
def datagramReceived(self, datagram, (host, incPort)):
port = incPort
address = "%s:%s" % (host,port)
c.execute("INSERT INTO tf2_log (address, line) VALUES(%s)",(address,cmd))
reactor.listenUDP(27500, TF2LogInject())
reactor.run()[/code]
Thanks so much will this log everything, not just chat.
Sorry, you need to Log In to post a reply to this thread.