Spaces:
Running
Running
Jeremiah Lowin opencode commited on
docs(client/logging): reflect corrected default log level mapping (#1403)
Browse files- docs/clients/logging.mdx +2 -2
docs/clients/logging.mdx
CHANGED
|
@@ -100,12 +100,12 @@ async def detailed_log_handler(message: LogMessage):
|
|
| 100 |
|
| 101 |
## Default Log Handling
|
| 102 |
|
| 103 |
-
If you don't provide a custom `log_handler`, FastMCP
|
| 104 |
|
| 105 |
```python
|
| 106 |
client = Client("my_mcp_server.py")
|
| 107 |
|
| 108 |
async with client:
|
| 109 |
-
# Server logs
|
| 110 |
await client.call_tool("some_tool")
|
| 111 |
```
|
|
|
|
| 100 |
|
| 101 |
## Default Log Handling
|
| 102 |
|
| 103 |
+
If you don't provide a custom `log_handler`, FastMCP's default handler routes server logs to the appropriate Python logging levels. The MCP levels are mapped as follows: `notice` → INFO; `alert` and `emergency` → CRITICAL. If the server includes a logger name, it is prefixed in the message, and any `extra` data is forwarded via the logging `extra` parameter.
|
| 104 |
|
| 105 |
```python
|
| 106 |
client = Client("my_mcp_server.py")
|
| 107 |
|
| 108 |
async with client:
|
| 109 |
+
# Server logs are forwarded at their proper severity (DEBUG/INFO/WARNING/ERROR/CRITICAL)
|
| 110 |
await client.call_tool("some_tool")
|
| 111 |
```
|