By default, Jupyter notebooks send logs to standard error instead of standard output, which means your logs will not show up in your notebook cell output unless you configure logging as we do below.
If logging is not currently configured to send logs to standard output for your Python environment, you’ll need to explicitly turn it on as follows:
Copy
Ask AI
import logging# Note: this will affect _all_ packages that use python's built-in logging mechanism, # so may increase your log volume. Pick the right log level for your use case.logging.basicConfig(level=logging.WARNING)
When debugging an issue, it’s helpful to increase logs to a higher level verbosity so more info is outputted to standard output. Python loggers default to using WARNING log level, but you can choose different values to get different levels of verbosity. The values, from least verbose to most, are ERROR, WARNING, INFO, and DEBUG. You can set this as follows:
Copy
Ask AI
import langsmithimport logging# Loggers are hierarchical, so setting the log level on "langsmith" will# set it on all modules inside the "langsmith" packagelangsmith_logger = logging.getLogger("langsmith")langsmith_logger.setLevel(level=logging.DEBUG)