[Twisted-Python] twistd .tac and ILogObserver
Christopher Armstrong
radix at twistedmatrix.com
Thu Nov 20 12:58:12 MST 2008
On Thu, Nov 20, 2008 at 12:50 PM, Werner Thie <wthie at thiengineering.ch> wrote:
> Hi
>
> I tried to enhance my test.tac file with
>
> :
> application = service.Application("test")
> application.setComponent(ILogObserver, LogFile('test.log', '/var/log/',
> rotateLength=10000).write)
You should not pass the write method as an observer: an observer must
be a callable that takes a dict.
You probably want to import FileLogObserver from twisted.python.log,
and pass an instance of that:
application.setComponent(ILogObserver,
FileLogObserver(LogFile("test.log", "/var/log", rotateLength=10000)))
--
Christopher Armstrong
http://radix.twistedmatrix.com/
http://planet-if.com/
http://canonical.com/
More information about the Twisted-Python
mailing list