← Back to Foundation

JIDO LOG CONTROL ANALYSIS

Documentation for JIDO_LOG_CONTROL_ANALYSIS from the Foundation repository.

Jido Action Log Control Analysis

Key Findings ✅

You are 100% correct - the verbose logs are coming from the Jido library itself, and YES, we CAN control them as users of the library!

Root Cause

The verbose logs come from agentjido/jido_action/lib/jido_action/exec.ex at lines 131-135:

cond_log(
  log_level,
  :notice,
  "Executing #{inspect(action)} with params: #{inspect(validated_params)} and context: #{inspect(enhanced_context)}"
)

How the Log Level Works

  1. Default log level: :info (line 116 in jido_action/exec.ex)

    log_level = Keyword.get(opts, :log_level, :info)
    
  2. Conditional logging: Uses cond_log/3 which only logs if log_level allows :notice

    # From jido_action/util.ex:51
    Logger.compare_levels(threshold_level, message_level) in [:lt, :eq] ->
      Logger.log(message_level, message, opts)
    
  3. Log level hierarchy: :debug < :info < :notice < :warning < :error

    • Since default is :info and message is :notice, the log will appear
    • If we set log_level to :warning, the notice logs will be suppressed

How We Can Control It ✅

Option 1: Runner-Level Configuration (Most Direct)

When calling Jido runners, we can pass log_level: :warning:

# In JidoSystem agents - add log_level to runner options
{:ok, agent, directives} = Runner.Simple.run(agent, log_level: :warning)

Option 2: Instruction-Level Configuration

When creating instructions, add log_level to opts:

instruction = %Instruction{
  action: MyAction,
  params: %{...},
  opts: [log_level: :warning]  # This suppresses notice logs
}

Option 3: Agent Configuration

Configure the agent to use a higher log level by default.

Option 4: Jido Configuration (Global)

If Jido supports global configuration:

# In config/config.exs
config :jido_action, log_level: :warning

Verification of Control

Looking at the runner code in agentjido/jido/lib/jido/runner/simple.ex:

# Line 125: Merges runner opts with instruction opts
merged_opts = Keyword.merge(opts, instruction.opts)

# Line 135: Passes merged opts to Jido.Exec.run
case Jido.Exec.run(instruction) do

This confirms that we can control the log level by passing options to the runner.

Immediate Fix Locations

We need to find where in our lib/jido_system/ code we’re calling Jido runners and add log_level: :warning:

  1. Agent implementations - wherever Runner.Simple.run or Agent.run is called
  2. Action executions - wherever Jido.Exec.run is called directly

Next Steps

  1. Find all Jido runner calls in our codebase
  2. Add log_level: :warning to suppress notice logs
  3. Test to confirm verbose logs are suppressed

Conclusion

YES, we can absolutely control these logs! The Jido library provides proper log level configuration through the opts parameter. We just need to identify where our code calls Jido functions and add the appropriate log level configuration.

The issue is that the default log level is :info which allows :notice logs through. By changing it to :warning, we suppress the verbose action execution logs while keeping important warnings and errors.