Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions docs/docs/documentation/deploying/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,28 @@ To provide a logging configuration, set the `LOGGING_CONFIG_PATH=path/to/logging
While the INI format using Python's `fileConfig()` is still supported by Agent Mesh, it is not recommended due to [its limitations](https://docs.python.org/3/library/logging.config.html#configuration-file-format) compared to YAML and JSON formats.
:::

:::info[Agent/Gateway Specific Logging Configuration]
## Simple Logging Configuration
While individual agent and gateway YAML files may contain a log section similar to the example below:
```
log:
stdout_log_level: INFO
log_file_level: INFO
log_file: my-agent.log
```

When using the simple `log:` section in agent or gateway configuration files, the following fields are available:

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `stdout_log_level` | string | Yes | `INFO` | Logging level for console output. Valid values: `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL` |
| `log_file_level` | string | No | `INFO` | Logging level for file output. Typically set to `DEBUG` for detailed troubleshooting |
| `log_file` | string | No | None | Path to the log file. If not specified, file logging is disabled. Examples: `agent.log`, `/var/log/sam/agent.log` |

:::note
using a dedicated logging configuration file (YAML, JSON) is the recommended approach. The simple `log:` section configuration has lower precedence and will only be active when a dedicated logging configuration file is not provided.
:::

## Default Logging Configuration
## Advanced Logging Configuration

When you run `sam init`, Agent Mesh automatically generates a `configs/logging_config.yaml` file in your project directory. This file establishes sensible defaults while remaining easy to customize for your specific needs.

Expand Down Expand Up @@ -268,4 +278,4 @@ sam run configs/gateways/webui.yaml configs/agents/main_orchestrator.yaml config
export LOGGING_FILE_NAME=my_isolated_agent.log && sam run configs/agents/my_agent_with_isolated_logs.yaml # logs go to my_isolated_agent.log
```

This approach allows you to isolate and analyze a specific agent's behavior without interference from other components in your mesh. Each process writes to its own log file, making debugging much easier.
This approach allows you to isolate and analyze a specific agent's behavior without interference from other components in your mesh. Each process writes to its own log file, making debugging much easier.
Loading