[Twisted-Python] How to get ServerOptions in tac file.

Jonas Brunsgaard jonas.brunsgaard at gmail.com
Sun Nov 24 16:55:51 MST 2013


On Sun, Nov 24, 2013 at 9:43 PM, <exarkun at twistedmatrix.com> wrote:

> On 07:35 pm, jonas.brunsgaard at gmail.com wrote:
>
>> Is there an easy way get an options object from the  .tac file?
>>
>> I my .tac file i have the following.
>>
>> fh = logging.FileHandler('/var/log/ocmg/datastore.log')
>>
>> I would like to be able et replace '/var/log/ocmg/datastore.log' with the
>> logfile option given by the user at the command line.
>>
>> Any suggestions?
>>
>
> See http://stackoverflow.com/questions/18244050/


Okay. Thank you for the answer!

Does anyone know if there are any plans to update, the logging system
in twistd at some point, so it integrates better with native python logging
system?

I have to use the following logging scheme (glog - google logging)

I1125 00:38:34. 309273 140138991519488 log.py:443] Main loop terminated.
I1125 00:38:34. 309624 140138991519488 log.py:443] Server Shut Down.
I1125 00:41:09. 665297 140705081902848 log.py:443] Loaded.

would the easiest way to accomplich this be to just implement a
logger and use the --logger option with twisted?

Idealy I also need more log levels, is that possible?


> Jean-Paul
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20131125/b3dd5595/attachment.html>


More information about the Twisted-Python mailing list