Collecting Information and Logging in the Python SDK with Couchbase Server

    +

    The Python SDK allows logging via the standard logging module, or via the LCB_LOGLEVEL environment variable.

    import logging
    import sys
    
    import couchbase
    from couchbase.bucket import Bucket
    
    logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
    couchbase.enable_logging()
    
    c = Bucket('couchbase://localhost/default')
    c.upsert('key', ['value'])

    The logging itself is done by the underlying C SDK.

    Unresolved include directive in modules/ROOT/pages/collecting-information-and-logging.adoc - include::2.8@c-sdk::page$collecting-information-and-logging.adoc[]