Skip to main content

Logging Configuration Guide

Simba Intelligence uses a flexible, module-level logging system that lets you control exactly how much detail you see — from high-level milestones to full LLM prompt traces. This guide explains how to configure logging and which configuration to use for each debugging scenario.

Overview

Logging is controlled through a single environment variable, LOG_LEVELS, which accepts a JSON array. Each entry targets a specific internal module and sets its log verbosity independently. By default, only WARNING and above are shown. Modules you explicitly list in LOG_LEVELS will log at the level you specify, giving you surgical control over noise vs. detail.

Log Levels

LevelWhat It ShowsWhen to Use It
DEBUGEverything — all internal logic, loops, and decisionsTracing a specific flow step-by-step
INFOKey events — decisions made, data created, milestones reachedMonitoring normal operation at a high level
WARNINGNon-fatal problems — retries, fallbacks, edge casesSomething went slightly wrong but didn’t break execution
ERRORFailures that block an operation — exceptions, failed callsSomething broke and needs immediate attention
CRITICALSystem-level failures — data loss risk, service unavailableThe system cannot continue operating

How It Works

Set LOG_LEVELS as a JSON array environment variable. Each entry specifies a module name and the log level to apply to it.
LOG_LEVELS='[{"module": "<logger-name>", "logLevel": "<LEVEL>"}]'
Key points:
  • The underlying log handler is set to DEBUG — it passes everything through. All filtering is controlled by the per-module levels you set here.
  • Only modules you list will log below the default WARNING threshold.
  • You can mix levels across modules in a single configuration (e.g. DEBUG for a specific service, INFO for supporting ones).

Configurations by Scenario

Pick the scenario that matches what you need to investigate and paste the corresponding LOG_LEVELS value into your environment.

1. Trace the Full Question-to-Answer Path

Follows a user’s question from intake → cache check → LLM orchestration → Composer data fetch → natural language conversion → SSE response stream.
LOG_LEVELS='[
  {"module": "simba_intelligence.api.agent_controller",                   "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_retriever",                  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_converter_natural_language",  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_semantic_cache",                  "logLevel": "INFO"},
  {"module": "simba_intelligence.composer.composer_api_client",           "logLevel": "INFO"},
  {"module": "simba_intelligence.models.api.event_stream",                "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.history_service",               "logLevel": "INFO"}
]'
You will see:
  • Cache hit or miss for the incoming question
  • Base request body, selected fields, aggregation type, time filters, and output type
  • Composer request sent and response status code
  • Generated natural language answer text
  • History record created
  • SSE event types streamed back to the client

2. Audit All LLM Prompts and Responses

Captures every prompt sent to and every response received from the LLM, across all product features.
LOG_LEVELS='[
  {"module": "simba_intelligence.llm.callbacks.prompt_logging_callback", "logLevel": "DEBUG"}
]'
You will see:
  • [LLM Call] — model name, run ID, and full message content (system / human / AI roles)
  • [LLM Response] — model name, run ID, and full generated text
  • [LLM Error] — run ID and error details
This single module covers LLM calls across data retrieval, chat, and data source creation, because the callback is attached at the factory level.

3. Full End-to-End Trace (Question + LLM Prompts)

Combines scenarios 1 and 2 for complete visibility including the exact prompts sent at each step.
LOG_LEVELS='[
  {"module": "simba_intelligence.api.agent_controller",                   "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_retriever",                  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_converter_natural_language",  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_semantic_cache",                  "logLevel": "INFO"},
  {"module": "simba_intelligence.llm.callbacks.prompt_logging_callback",  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.composer.composer_api_client",           "logLevel": "INFO"},
  {"module": "simba_intelligence.models.api.event_stream",                "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.history_service",               "logLevel": "INFO"}
]'
See scenarios 1 and 2 for what to expect.

4. Debug Visual Generation

Focuses on chart and graph creation.
LOG_LEVELS='[
  {"module": "simba_intelligence.llm.ai_generate_visual",            "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.callbacks.prompt_logging_callback", "logLevel": "DEBUG"}
]'
You will see:
  • Visual type selected, payload constructed, and visual created
  • Filter issues, creation retries, and exhausted retry attempts
  • LLM prompts requesting visual specifications

5. Debug Data Source Creation and Onboarding

Focuses on the data source setup pipeline — schema analysis, column formatting, and suggestion generation.
LOG_LEVELS='[
  {"module": "simba_intelligence.llm.ai_data_source_creator",        "logLevel": "INFO"},
  {"module": "simba_intelligence.composer.composer_sources",          "logLevel": "DEBUG"},
  {"module": "simba_intelligence.composer.composer_settings",         "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.callbacks.prompt_logging_callback", "logLevel": "DEBUG"}
]'
You will see:
  • Schema analysis steps and column formatting decisions
  • Suggestion generation
  • Token limit warnings and API errors
  • Source data fetches, sample values, and cached stats
  • Global settings lookups
  • All LLM prompts for schema analysis

6. Debug Composer (Data Layer) Communication

Focuses on all HTTP calls to the Composer backend and source data operations.
LOG_LEVELS='[
  {"module": "simba_intelligence.composer.composer_api_client",       "logLevel": "INFO"},
  {"module": "simba_intelligence.composer.composer_sources",          "logLevel": "DEBUG"},
  {"module": "simba_intelligence.composer.composer_settings",         "logLevel": "DEBUG"}
]'
You will see:
  • Every Composer HTTP request (method + endpoint) and response status code
  • Failed fetches and timeouts
  • Source data lookups, sample values, cached stats, and fuzzy matches

7. Debug Redis and Caching

Focuses on Redis operations — semantic cache, source indexes, and vector search.
LOG_LEVELS='[
  {"module": "simba_intelligence.services.redis_service",             "logLevel": "INFO"},
  {"module": "simba_intelligence.llm.ai_semantic_cache",             "logLevel": "INFO"}
]'
You will see:
  • Redis connection pool initialization and close events
  • Index creation, search queries, vector searches, and result counts
  • Cache hits, misses, and updates
  • Clear and delete operations

8. Debug Authentication and Session Management

Focuses on token lifecycle, OAuth flows, and tenant switching.
LOG_LEVELS='[
  {"module": "simba_intelligence.api.auth_controller",                "logLevel": "INFO"},
  {"module": "simba_intelligence.services.oauth_service",             "logLevel": "INFO"}
]'
You will see:
  • Token generation, revocation, and rotation
  • OAuth client registration and authorization codes
  • Tenant switching
  • Session management events

9. Debug LLM Configuration Management

Focuses on provider configuration CRUD, capability changes, and AI service factory errors.
LOG_LEVELS='[
  {"module": "simba_intelligence.api.llm_configuration_controller",   "logLevel": "ERROR"},
  {"module": "simba_intelligence.services.llm_configuration_service", "logLevel": "INFO"},
  {"module": "simba_intelligence.llm.services.ai_service_factory",   "logLevel": "ERROR"}
]'
You will see:
  • Configuration CRUD operations
  • Capability activation and deactivation
  • Embeddings model changes
  • Factory errors when creating AI services

10. Debug Rules Service

Focuses on rule creation, updates, deletions, and permission enforcement.
LOG_LEVELS='[
  {"module": "simba_intelligence.services.rules_service",             "logLevel": "INFO"}
]'
You will see:
  • Rule creation, update, and deletion
  • Permission violations (e.g. a user attempting to modify tenant-wide rules)
  • Missing rules lookups

11. Debug the Chat (Multi-Turn) Feature

Focuses on the conversational AI agent that invokes tools iteratively across multiple turns.
LOG_LEVELS='[
  {"module": "simba_intelligence.llm.ai_data_chat",                  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.callbacks.prompt_logging_callback", "logLevel": "DEBUG"},
  {"module": "QueryDataTool",                                        "logLevel": "DEBUG"},
  {"module": "CreateVisualTool",                                     "logLevel": "DEBUG"},
  {"module": "GetSuggestionsTool",                                   "logLevel": "DEBUG"},
  {"module": "GetDataSourceFieldStatisticsTool",                     "logLevel": "DEBUG"}
]'
You will see:
  • Each tool iteration and its result
  • Final answer generation
  • Max-iteration warnings
  • Tool execution errors
  • All LLM prompts and responses within the chat loop

12. Full Debug — Everything at DEBUG

Warning: This is extremely verbose. Use only when you need complete system visibility and are prepared to filter through high log volume.
LOG_LEVELS='[
  {"module": "simba_intelligence.api.agent_controller",              "logLevel": "DEBUG"},
  {"module": "simba_intelligence.api.auth_controller",               "logLevel": "DEBUG"},
  {"module": "simba_intelligence.api.llm_configuration_controller",  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_retriever",             "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_chat",                  "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_generate_visual",            "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_source_creator",        "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_data_converter_natural_language", "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.ai_semantic_cache",             "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.callbacks.prompt_logging_callback", "logLevel": "DEBUG"},
  {"module": "simba_intelligence.llm.services.ai_service_factory",   "logLevel": "DEBUG"},
  {"module": "simba_intelligence.composer.composer_api_client",      "logLevel": "DEBUG"},
  {"module": "simba_intelligence.composer.composer_sources",          "logLevel": "DEBUG"},
  {"module": "simba_intelligence.composer.composer_settings",         "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.history_service",          "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.redis_service",            "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.rules_service",            "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.suggestion_service",       "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.oauth_service",            "logLevel": "DEBUG"},
  {"module": "simba_intelligence.services.llm_configuration_service","logLevel": "DEBUG"},
  {"module": "simba_intelligence.models.api.event_stream",           "logLevel": "DEBUG"},
  {"module": "QueryDataTool",                                        "logLevel": "DEBUG"},
  {"module": "CreateVisualTool",                                     "logLevel": "DEBUG"},
  {"module": "GetSuggestionsTool",                                   "logLevel": "DEBUG"},
  {"module": "GetDataSourceFieldStatisticsTool",                     "logLevel": "DEBUG"}
]'

Module Reference

Use this table to identify which module to target for a specific area of the system.
ModuleWhat It Logs
simba_intelligence.llm.ai_data_retrieverField selection, filters, aggregation, query assembly
simba_intelligence.llm.ai_data_chatTool iterations, tool results, final answers
simba_intelligence.llm.ai_generate_visualVisual type, payload, retry attempts
simba_intelligence.llm.ai_data_source_creatorSchema analysis, column formatting, suggestions
simba_intelligence.llm.ai_data_converter_natural_languageNatural language answer text
simba_intelligence.llm.callbacks.prompt_logging_callbackFull LLM prompts and responses (all features)
simba_intelligence.llm.ai_semantic_cacheCache hit / miss / update
simba_intelligence.llm.services.ai_service_factoryModel creation errors
simba_intelligence.composer.composer_api_clientHTTP requests and response status codes
simba_intelligence.composer.composer_sourcesSource data, sample values, stats cache
simba_intelligence.composer.composer_settingsGlobal settings lookups
simba_intelligence.services.history_serviceQuestion history records
simba_intelligence.services.redis_serviceIndex operations, searches, cache operations
simba_intelligence.services.rules_serviceRule CRUD, permission checks
simba_intelligence.services.suggestion_serviceSuggestion generation and retrieval
simba_intelligence.api.agent_controllerRequest validation errors, stream errors
simba_intelligence.api.auth_controllerToken lifecycle, tenant switching
QueryDataToolTool invocation with sanitized question
CreateVisualToolVisual creation errors
GetSuggestionsToolSuggestion retrieval details
GetDataSourceFieldStatisticsToolField statistics requests