4 from twisted.application import service
5 from buildbot.master import BuildMaster
8 rotateLength = 10000000
11 # if this is a relocatable tac file, get the directory containing the TAC
14 basedir = os.path.abspath(os.path.dirname(__file__))
16 # note: this line is matched against to check that this is a buildmaster
17 # directory; do not edit it.
18 application = service.Application('buildmaster')
21 from twisted.python.logfile import LogFile
22 from twisted.python.log import ILogObserver, FileLogObserver
23 logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
24 maxRotatedFiles=maxRotatedFiles)
25 application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
27 # probably not yet twisted 8.2.0 and beyond, can't set log yet
30 configfile = r'master.cfg'
32 m = BuildMaster(basedir, configfile)
33 m.setServiceParent(application)
34 m.log_rotation.rotateLength = rotateLength
35 m.log_rotation.maxRotatedFiles = maxRotatedFiles