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

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?

On 07:35 pm, jonas.brunsgaard@gmail.com wrote:
See http://stackoverflow.com/questions/18244050/ Jean-Paul

On Sun, Nov 24, 2013 at 9:43 PM, <exarkun@twistedmatrix.com> wrote:
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?

On 24 Nov, 11:55 pm, jonas.brunsgaard@gmail.com wrote:
What does "integrates better" mean?
twisted.python.log doesn't explicitly support log levels. Instead, it supports arbitrary structured data (log levels are one example of this). log.msg(level="DEBUG", ...) What else are you looking for? Jean-Paul

On 07:35 pm, jonas.brunsgaard@gmail.com wrote:
See http://stackoverflow.com/questions/18244050/ Jean-Paul

On Sun, Nov 24, 2013 at 9:43 PM, <exarkun@twistedmatrix.com> wrote:
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?

On 24 Nov, 11:55 pm, jonas.brunsgaard@gmail.com wrote:
What does "integrates better" mean?
twisted.python.log doesn't explicitly support log levels. Instead, it supports arbitrary structured data (log levels are one example of this). log.msg(level="DEBUG", ...) What else are you looking for? Jean-Paul
participants (2)
-
exarkun@twistedmatrix.com
-
Jonas Brunsgaard