Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

zope.server wrapper that registers with ZooKeeper

Project Description

zc.zkzopeserver provides a wrapper for the zope.server WSGI runner that registers with ZooKeeper. By registering with ZooKeeper, you can let the operating system assign ports and have clients find your server by looking in ZooKeeper.

Basic Usage

The wrapper is used in a past-deploy configuration file:

use = egg:zc.zkzopeserver
zookeeper =
path = /fooservice/providers

The wrapper supports the following options:

required ZooKeeper connection string

required path at which to register your server

Your server is registered by adding a ZooKeeper ephemeral node as a child of the path with the server address as the name.

host name or ip to listen on, defaulting to ‘’
The port to listen on, defaulting to 0
A ZooKeeper session timeout in milliseconds
The size of the thread pool, defaulting to 1

A zc.monitor server address.

The value is an address of the form HOST:PORT. See Monitor server below. (Host can be empty to listen on all interfaces.)


Logging configuration.

This can be one of:

  • A logging level name (CRITICAL, ERROR, WARNING, INFO, or DEBUG), or

  • A ZConfig loggers-definition string.

    If the configuration includes format strings, you’ll need to use double dollar signs rather than %, as in:

    format $$(message)s

    This is necessary due to the use of string formats in the Paste Deployment configuration syntax.

Monitor server

The zc.monitor package provides a simple extensible command server for gathering monitoring data or providing run-time control of servers. If zc.monitor is in the Python path, zc.zkzopeserver can start a monitor server and make it’s address available as the monitor property of a server’s ephemeral port. To see how this works, let’s update the earler example:

use = egg:zc.zkzopeserver
zookeeper =
path = /fooservice/providers
monitor_server =

When our web server is running, the /fooservice/providers node would look something like:

    monitor = u''
    pid = 4525

Some notes on the monitor server:

  • A monitor server won’t be useful unless you’ve registered some command plugins.
  • zc.monitor isn’t a dependency of zc.zkzopeserver and won’t be in the Python path unless you install it.

zc.zservertracslog integration

The package zc.zservertracelog extends zope.server to provide support for “trace” logs that have multiple log entries per web request as a request goes through various stages.

If you want to use zc.zservertraeslog with zc.zkzopeserver, make sure zc.zservertracelog is in your Python path and include the zservertracelog option in your server section:

use = egg:zc.zkzopeserver
zookeeper =
path = /fooservice/providers
monitor_server =
zservertracelog = true

Change History

0.3.0 (2012-02-02)

  • Added logging-configuration support.
  • Fixed: servers were registered with the host information returned by socket.getsockname(), which was unhelpful.
  • Fixed: Killing a server (with SIGTERM) didn’t shut down the ZooKeeper connection cleanly, causing a delay in removing registered ephemeral nodes.

0.2.0 (2012-01-18)

Added optional support for using zc.zservertracelog to generate trace logs.

0.1.0 (2011-12-11)

Initial release

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(8.0 kB) Copy SHA256 Hash SHA256
Source None Feb 3, 2012

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Kabu Creative Kabu Creative UX & Design Google Google Cloud Servers Fastly Fastly CDN StatusPage StatusPage Statuspage DigiCert DigiCert EV Certificate