
Logging
*******

Logging configuration is defined either in Etcd or via a local file.
In both cases the syntax is the same.


Example: Default Local file
===========================

   {
       "version": 1,
       "formatters": {
           "simple": {
               "format": "%(asctime)s - %(name)s - %(process)d -  %(thread)d - %(levelname)s - %(message)s"
           },
           "void": {
               "format": ""
           }
       },
       "handlers": {
           "console": {
               "class": "logging.StreamHandler",
               "formatter": "simple",
               "level": "DEBUG",
               "stream": "ext://sys.stdout"
           },
           "cherrypy": {
               "class": "logging.StreamHandler",
               "formatter": "void",
               "level": "DEBUG",
               "stream": "ext://sys.stdout"
           }
       },
       "loggers": {
           "cherrypy.access": {
               "handlers": ["cherrypy"],
               "level": "INFO",
               "propagate": false
           },
           "cherrypy.error": {
               "handlers": ["cherrypy"],
               "level": "INFO",
               "propagate": false
           },
           "authentication": {
               "handlers": ["console"],
               "level": "INFO",
               "propagate": false
           },
           "clusterexec": {
               "handlers": ["console"],
               "level": "INFO",
               "propagate": false
           },
           "containermgr": {
               "handlers": ["console"],
               "level": "INFO",
               "propagate": false
           },
           "investigator": {
               "handlers": ["console"],
               "level": "INFO",
               "propagate": false
           },
           "resources": {
               "handlers": ["console"],
               "level": "INFO",
               "propagate": false
           },
           "transport": {
               "handlers": ["console"],
               "level": "INFO",
               "propagate": false
           }
       },
       "root": {
           "handlers": ["console"],
           "level": "DEBUG"
       }
   }


Using Etcd
==========

To put the configuration in Etcd set the "/commissaire/config/logger"
key with valid JSON.

   (virtualenv)$ cat conf/logger.json | etcdctl set '/commissaire/config/logger'
   ...
