Collecting Information & Logging
- UNDER CONSTRUCTION
Logging with the Python SDK.
| the Logging implementation has changed substantially in SDK 4.0 and is not currently fully documented. This will be resolved in a future 4.x release. |
The Python SDK allows logging via the PYCBC_LOG_LEVEL environment variable.
Environmental Settings
In the command line environment, the PYCBC_LOG_LEVEL variable is set as follows:
export PYCBC_LOG_LEVEL=<log-level>
set PYCBC_LOG_LEVEL=<log-level>
Log Levels
You can increase the log level for greater verbosity (more information) in the logs:
-
off — disables all logging, which is normally set by default.
-
error — error messages.
-
warn — error notifications.
-
info — useful notices, not often.
-
debug — diagnostic information, required to investigate problems.
-
trace — the most verbose level.
Log Redaction
Redacting logs is a two-stage process.
If you want to redact client logs (for example before handing them off to the Couchbase Support team) you first need to enable log redaction in your application.
This is done through the ClusterOptions, setting log_redaction to True.
Once the SDK writes the logs with the tags to a file, you can then use the
cblogredaction tool to obfuscate the log.
-
You may wish to read more on Log Redaction in the Server docs.