简体   繁体   English

Cassandra CQLEngine增加日志记录的详细程度

[英]Cassandra cqlengine increase logging verbosity

I am new to cassandra python client. 我是cassandra python客户端的新手。 I am currently debugging an issue that I am having with my local cassandra client. 我目前正在调试本地cassandra客户端遇到的问题。 For the same, I want to increase the logging verbosity on the cassandra cqlengine client. 同样,我想增加cassandra cqlengine客户端上的日志记录详细程度。 I want to see detailed logs on what the client is doing as its making database calls. 我想查看有关客户端进行数据库调用时正在执行的操作的详细日志。 I couldn't find anyway to do it using the client api's that are defined in the documentation. 无论如何,我找不到使用文档中定义的客户端api来执行此操作的方法。

I am using cassandra cqlengine version 3.3.0 with python 2.6 . 我正在将cassandra cqlengine版本3.3.0与python 2.6 Thanks in advance. 提前致谢。

cqlengine uses standard Python logging. cqlengine使用标准的Python日志记录。 You can enable by configuring logging for the entire driver package, or select modules. 您可以通过配置整个驱动程序包或选择模块的日志记录来启用。

This log statement will show you statements going out of cqlengine (but not the actual bound attribute values. To setup basic console logging: 此日志语句将向您显示cqlengine以外的cqlengine (但不包括实际的绑定属性值。要设置基本控制台日志记录,请执行以下操作:

import logging
logging.basicConfig()
logger = logging.getLogger('cassandra.cqlengine.connection')
logger.setLevel(logging.DEBUG)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM