Esempio n. 1
0
def setup_logging(conf):
    """
    Sets up the logging options for a log with supplied name

    :param conf: a cfg.ConfOpts object
    """
    product_name = "hotzenplotz"
    logging.setup(product_name)
    log_root = logging.getLogger(product_name).logger
    log_root.propagate = 0
    LOG.info(_("Logging enabled!"))
Esempio n. 2
0
def notify(_context, message):
    """Notifies the recipient of the desired event given the model.
    Log notifications using openstack's default logging system"""

    priority = message.get('priority',
                           CONF.default_notification_level)
    priority = priority.lower()
    logger = logging.getLogger(
        'hotzenplotz.openstack.common.notification.%s' %
        message['event_type'])
    getattr(logger, priority)(jsonutils.dumps(message))
Esempio n. 3
0
#    License for the specific language governing permissions and limitations
#    under the License.

"""
Routines for config hotzenplotz
"""
import os
import sys

from paste import deploy

from hotzenplotz.openstack.common import cfg
from hotzenplotz.openstack.common import log as logging


LOG = logging.getLogger(__name__)

core_opts = [
    cfg.StrOpt('state_path',
               default='/var/lib/hotzenplotz',
               help='Top-level directory for maintaining hotzenplotz'),
    cfg.StrOpt('api_paste_config',
               default='api-paste.ini',
               help='paste configuration file'),
    cfg.StrOpt('auth_strategy',
               default='noauth',
               help='authorize strategy'),
    cfg.StrOpt('api_listen',
               default='127.0.0.1',
               help='IP address for hotzenplotz API to listen.'),
    cfg.IntOpt('api_listen_port',
Esempio n. 4
0
 def _run(self, application, socket):
     """Start a WSGI server in a new green thread."""
     logger = logging.getLogger('eventlet.wsgi')
     eventlet.wsgi.server(socket, application, custom_pool=self.tg.pool,
                          log=logging.WritableLogger(logger))