1

I try to write a small service with twisted.

I created a simple Application, and try to add 2 ILogObservers to my service. But unfortunatly, it doesnt work. The last added Observer is always the observer that will be used.

def log(eventDict):
...

def mylog(eventDict):
...

LoopingCall(logSomething).start(1)

application = Application("twistd-logging")
application.setComponent(ILogObserver, log)
application.setComponent(ILogObserver, mylog)

Thanks in advance for your help.

Carsten
  • 31
  • 2

1 Answers1

2

kay, I found the solution, it was far easier then I suspected.

I just have to add

from twisted.python.log import addObserver 

if I have a secondary log observer

def mylogobserver(eventDict):
    # doSth

I can add it VERY SIMPLE with

addObserver(mylogobserver)

Best regards

Carsten
  • 31
  • 2