summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core/bitmaskd.tac
blob: ac7e1383615a3b47a019709cf0a09fc4116a1353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Service composition for bitmask-core.
# Run as: twistd -n -y bitmaskd.tac
#
from twisted.application import service
from twisted.logger import ILogObserver
from twisted.logger import FileLogObserver
from twisted.logger import formatEventAsClassicLogText as formatEvent

from leap.bitmask.core.service import BitmaskBackend
from leap.bitmask.core.logs import logFileFactory

bb = BitmaskBackend()
application = service.Application("bitmaskd")

# configure logging
log_file =  logFileFactory()
observer = FileLogObserver(log_file, formatEvent)
application.setComponent(ILogObserver, observer)

bb.setServiceParent(application)