elogger.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:pylogging 作者: ansrivas 项目源码 文件源码
def __log(self, msg, level):
        payload = {'app_name': str(self.app_name), 'log_level': level, 'message': msg}
        try:
            self.session.post(url=self.elastic_url, data=json.dumps(payload),
                              headers=self.headers, auth=self.auth)
        except ConnectionError as ce:
            logging.error(ce.message)
            logging.exception('Unable to connect to Elastic Search. Check the `elastic_url` and `auth`')
            logging.error(msg)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号