#869: [PATCH] config.py/startup.py log_config_map
---------------------------------+------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |       Owner:  anonymous
     Type:  enhancement          |      Status:  new      
 Priority:  normal               |   Milestone:  1.0b1    
Component:  TurboGears           |     Version:  0.9a6    
 Severity:  normal               |    Keywords:  logging  
---------------------------------+------------------------------------------
 This is a proposition. I don't think this should be the final
 implementation. I'll leave that to those who have a better understanding
 of the startup process of tg/cp than me.
 The motivation is that I'd really like to see the servers configuration
 parameters when running in production mode.

 {{{
 config.py - (method is basically a copy/paste of method in
 cherrypy:config.py)

 def logConfigMap():
     """Log server configuration parameters"""
     log = logging.getLogger("turbogears.access")
     log.info("Server parameters:")
     serverVars = [
                   'server.environment',
                   'server.log_to_screen',
                   'server.log_file',
                   'server.log_tracebacks',
                   'server.log_request_headers',
                   'server.protocol_version',
                   'server.socket_host',
                   'server.socket_port',
                   'server.socket_file',
                   'server.reverse_dns',
                   'server.socket_queue_size',
                   'server.thread_pool',
                  ]

     for var in serverVars:
         log.info("%s  %s: %s" % ("CONFIG",var, get(var)))
 }}}

 {{{
 startup.py - (if server.log_config_map, log config to access_out)

 def start_server(root):
     cherrypy.root = root
     if turbogears.config.get("server.log_config_map",False):
         turbogears.config.logConfigMap()
     if turbogears.config.get("tg.fancy_exception", False):
         cherrypy.server.start(server=SimpleWSGIServer())
     else:
         cherrypy.server.start()
 }}}

 The main "problem" is that the output produced by a prod.cfg file is this:
 {{{
 Server parameters:
 CONFIG  server.environment: production
 CONFIG  server.log_to_screen: True
 CONFIG  server.log_file: server.logs
 CONFIG  server.log_tracebacks: True
 CONFIG  server.log_request_headers: False
 CONFIG  server.protocol_version: HTTP/1.0
 CONFIG  server.socket_host:
 CONFIG  server.socket_port: 8080
 CONFIG  server.socket_file:
 CONFIG  server.reverse_dns: False
 CONFIG  server.socket_queue_size: 5
 CONFIG  server.thread_pool: 10
 }}}

 Clearly "log_to_screen" should be false, but isn't..

-- 
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/869>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Tickets" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears-tickets
-~----------~----~----~----~------~----~------~--~---

Reply via email to