Skip to content

Bbox logging methods

Zeng Ke edited this page Jun 23, 2017 · 2 revisions

bbox is designed to be out-of-box tool, so the logging method is set be default to workable without any custom.

By default bbox log INFO+ messages to both syslog and console(stdout) and mute the lower level ones. but you can lightly custom the logging behavior by setting following environments

  • BBOX_LOG_LEVEL, the start log level, must be upper case and the values should be accept by python's logging module, for example
BBOX_LOG_LEVEL=DEBUG bbox start aiobbox.contrib.consumer.service --boxid universe
2017-06-23 14:58:52,169 root [DEBUG] watching boxes
2017-06-23 14:58:52,170 root [DEBUG] watching configs
2017-06-23 14:58:52,174 root [WARNING] box universe launched as 127.0.0.1:30103
2017-06-23 14:58:52,176 root [DEBUG] get boxes on change <class 'aio_etcd.EtcdResult'>({'action': 'create', 'key': '/pushdevelopment/boxes/127.0.0.1:30103', 'value': '{"bind": "127.0.0.1:30103", "boxid": "universe", "services": ["bbox.consumer"], "ssl": ""}', 'expiration': '2017-06-23T06:59:02.173640153Z', 'ttl': 10, 'modifiedIndex': 95713, 'createdIndex': 95713, 'newKey': False, 'dir': False, '_children': [], 'etcd_index': 95712, 'raft_index': 462019})
2017-06-23 14:58:52,178 root [DEBUG] watching boxes
  • BBOX_LOG_MUTE, a boolean env to mute logging to console if its value is set to one of "1", "true", "yes". logging to syslog daemon is intact.

Clone this wiki locally