[Twisted-Python] twistd/tac : when does logging start?
luke-lists at hybrid-logic.co.uk
Wed Nov 2 07:48:01 EDT 2011
On Wed, 2011-11-02 at 04:38 -0700, Tobias Oberstein wrote:
> I've got a Twisted application started via a tac file.
> Within the tac, I also initialize a database and create a db pool for use with adbapi.
> Now it seems that log messages from the network services are logged, but not from the initial DB setup stuff.
> When exactly does Twistd start the logging? How can I make it start logging from the very beginning?
> I've looked at the docs:
> "Before startLogging is called, log messages will be discarded and errors will be written to stderr."
> "If you are using twistd to run your daemon, it will take care of calling startLogging for you, ..."
> but that doesn't help me.
> Any hints are welcome
You need to do your intialisation (database connections, etc) in a
startService method of your application, rather than (as you're probably
doing) in the __init__ method.
Hope this helps.
CTO, Hybrid Logic Ltd.
Hybrid Web Cluster - cloud web hosting
Mobile: +447791750420 (UK) / +1-415-449-1165 (US)
More information about the Twisted-Python