Skip to content

Configuring Logging

By default, AI JSON logs only warnings and errors.

In INFO logs, AI JSON includes:

  • how long actions run for,
  • how long actions block the event loop for,
  • prompts and their responses.

If you would like to change what level of logs are shown, either:

Run your script with the --log-level flag, e.g.:

Terminal window
python my_script.py --log-level INFO

Run it with the LOG_LEVEL env var, e.g.:

Terminal window
LOG_LEVEL=INFO python my_script.py

Or, call from within your code:

import logging
from aijson.log_config import configure_logging
configure_logging(pretty=False, level=logging.INFO)