[Checkins] SVN: grokproject/trunk/grokproject/template/ Drastically simplify the debug.ini and deploy.ini files. No longer use the eventlog section in the zope.conf for configuring the eventlog - this is now done in the deploy.ini file. In debug-mode all output is sent to the console. The app is nog setup as a paster pipeline which makes it much more understandable.

Jan-Wijbrand Kolman janwijbrand at gmail.com
Sun May 30 16:04:58 EDT 2010


Log message for revision 112861:
  Drastically simplify the debug.ini and deploy.ini files. No longer use the eventlog section in the zope.conf for configuring the eventlog - this is now done in the deploy.ini file. In debug-mode all output is sent to the console. The app is nog setup as a paster pipeline which makes it much more understandable.

Changed:
  U   grokproject/trunk/grokproject/template/buildout.cfg_tmpl
  U   grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl
  U   grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl
  U   grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl
  A   grokproject/trunk/grokproject/template/log/

-=-
Modified: grokproject/trunk/grokproject/template/buildout.cfg_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2010-05-30 19:06:58 UTC (rev 112860)
+++ grokproject/trunk/grokproject/template/buildout.cfg_tmpl	2010-05-30 20:04:57 UTC (rev 112861)
@@ -38,16 +38,20 @@
        PasteDeploy
 interpreter = python-console
 
+[deploy_ini]
+recipe = collective.recipe.template
+input = etc/deploy.ini.in
+output = $${buildout:parts-directory}/etc/deploy.ini
+host = 127.0.0.1
+port = 8080
+
 [debug_ini]
 recipe = collective.recipe.template
 input = etc/debug.ini.in
 output = $${buildout:parts-directory}/etc/debug.ini
+host = 127.0.0.1
+port = 8080
 
-[deploy_ini]
-recipe = collective.recipe.template
-input = etc/deploy.ini.in
-output = $${buildout:parts-directory}/etc/deploy.ini
-
 # this section named so that the i18n scripts are called bin/i18n...
 [i18n]
 recipe = z3c.recipe.i18n:i18n

Modified: grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl	2010-05-30 19:06:58 UTC (rev 112860)
+++ grokproject/trunk/grokproject/template/etc/debug.ini.in_tmpl	2010-05-30 20:04:57 UTC (rev 112861)
@@ -1,76 +1,44 @@
-# debug.ini
-#
-# Debugging configuration for use with paster/WSGI
-#
+[DEFAULT]
+zope_conf = %(here)s/zope.conf
 
-[loggers]
-keys = root, wsgi, grok
+[server:main]
+use = egg:Paste#http
+host = $${:host}
+port = $${:port}
 
-[handlers]
-keys = console, accesslog
+[pipeline:main]
+pipeline = accesslogging evalexception grok
 
-[formatters]
-keys = generic, accesslog
+[filter:accesslogging]
+use = egg:Paste#translogger
 
-[formatter_generic]
-format = %(asctime)s %(levelname)s [%(name)s] %(message)s
+[filter:evalexception]
+use = egg:z3c.evalexception#ajax
 
-[formatter_accesslog]
-format = %(message)s
+[app:grok]
+use = egg:grokcore.startup#debug
+exempt-exceptions = zope.security.interfaces.IUnauthorized
 
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
-level = NOTSET
-formatter = generic
+# Logging configuration
 
-[handler_accesslog]
-class = FileHandler
-args = (os.path.join(r'$${zope_conf:logfiles}', 'access.log'),
-        'a')
-level = INFO
-formatter = accesslog
+[loggers]
+keys = root
 
 [logger_root]
 level = INFO
 handlers = console
 
-[logger_wsgi]
-level = INFO
-handlers = accesslog
-qualname = wsgi
-propagate = 0
+[handlers]
+keys = console
 
-[logger_grok]
-# Set level to ERROR or above if you want to suppress
-# grok template registry warnings on commandline.
-level = INFO
-handlers = console
-qualname = grokcore.view
-propagate = 0
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
 
+[formatters]
+keys = generic
 
-[filter:translogger]
-use = egg:Paste#translogger
-setup_console_handler = False
-logger_name = wsgi
-
-[filter-app:main]
-# Change the last part from 'ajax' to 'pdb' for a post-mortem debugger
-# on the console:
-use = egg:z3c.evalexception#ajax
-next = zope
-
-[app:zope]
-use = egg:grokcore.startup#debug
-filter-with = translogger
-exempt-exceptions = zope.security.interfaces.IUnauthorized
-
-[server:main]
-use = egg:Paste#http
-host = 127.0.0.1
-port = 8080
-
-[DEFAULT]
-# set the name of the zope.conf file
-zope_conf = %(here)s/zope.conf
\ No newline at end of file
+[formatter_generic]
+format = %(asctime)s %(levelname)s [%(name)s] %(message)s

Modified: grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl	2010-05-30 19:06:58 UTC (rev 112860)
+++ grokproject/trunk/grokproject/template/etc/deploy.ini.in_tmpl	2010-05-30 20:04:57 UTC (rev 112861)
@@ -1,68 +1,63 @@
-# deploy.ini
-#
-# Deployment configuration for use with paster/WSGI
-#
+[DEFAULT]
+zope_conf = %(here)s/zope.conf
 
-[loggers]
-keys = root, wsgi, grok
+[server:main]
+use = egg:Paste#http
+host = $${:host}
+port = $${:port}
 
-[handlers]
-keys = console, accesslog
+[pipeline:main]
+pipeline = gzip grok
 
-[formatters]
-keys = generic, accesslog
+[app:grok]
+use = egg:grokcore.startup
 
+[filter:gzip]
+use = egg:Paste#gzip
+
+# Logging configuration
+
+[loggers]
+keys = root, accesslogging, grok
+
 [logger_root]
 level = INFO
-handlers = console
+handlers = eventlog
 
-[logger_wsgi]
-level = INFO
-handlers = accesslog
-qualname = wsgi
-propagate = 0
-
 [logger_grok]
 # Set level to WARNING or below if you want to see
 # grok template registry warnings on commandline.
 level = ERROR
-handlers = console
-qualname = grokcore.view
+handlers = eventlog
+qualname = grok
 propagate = 0
 
-[handler_console]
-class = StreamHandler
-args = (sys.stderr,)
+[logger_accesslogging]
+level = INFO
+handlers = accesslog
+qualname = wsgi
+propagate = 0
+
+[handlers]
+keys = eventlog, accesslog
+
+[handler_eventlog]
+class = FileHandler
+args = (os.path.join(r'$${buildout:directory}', 'log', 'event.log'), 'a')
 level = NOTSET
 formatter = generic
 
 [handler_accesslog]
 class = FileHandler
-args = (os.path.join(r'$${zope_conf:logfiles}', 'access.log'),
-        'a')
+args = (os.path.join(r'$${buildout:directory}', 'log', 'accesslog.log'), 'a')
 level = INFO
 formatter = accesslog
 
+[formatters]
+keys = generic, accesslog
+
 [formatter_generic]
 format = %(asctime)s %(levelname)s [%(name)s] %(message)s
 
 [formatter_accesslog]
 format = %(message)s
-
-[filter:translogger]
-use = egg:Paste#translogger
-setup_console_handler = False
-logger_name = wsgi
-
-[app:main]
-use = egg:grokcore.startup
-filter-with = translogger
-
-[server:main]
-use = egg:Paste#http
-host = 127.0.0.1
-port = 8080
-
-[DEFAULT]
-# set the name of the zope.conf file
-zope_conf = %(here)s/zope.conf

Modified: grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl
===================================================================
--- grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl	2010-05-30 19:06:58 UTC (rev 112860)
+++ grokproject/trunk/grokproject/template/etc/zope.conf.in_tmpl	2010-05-30 20:04:57 UTC (rev 112861)
@@ -28,28 +28,13 @@
 </zodb>
 
 <eventlog>
-  # This sets up logging to a file.
-  # The "path" setting can be a relative or absolute
-  # filesystem path.
-
-  <logfile>
-    path $${zope_conf:logfiles}/z3.log
-    formatter zope.exceptions.log.Formatter
-  </logfile>
-
-  # This sets up logging to to standard output.
-  # The "path" setting can be the tokens STDOUT or STDERR
-  
-#  <logfile>
-#    path STDOUT
-#    formatter zope.exceptions.log.Formatter
-#  </logfile>
+# logfiles are setup in the debug.ini and deploy.ini files.
 </eventlog>
 
 # Comment this line to disable developer mode.  This should be done in
 # production
 devmode on
 
-# Extra configuration lines can be added to zope_conf's extra option. Put for 
+# Extra configuration lines can be added to zope_conf's extra option. Put for
 # instance productconf sections in here.
 $${zope_conf:extra}



More information about the checkins mailing list